From patchwork Mon Sep 2 22:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13787763 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 703AA19046E for ; Mon, 2 Sep 2024 22:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725316202; cv=none; b=Ye/o0Ih+pukIbyx/koI9jiUuticVZqM+i+5dNYiRDpXShwtpVGUO020smkgH80+XmDXynjemseTTIRyZf7sGDnqNNEK4zyX+gEDJ3Aklcqh8yhvg9pozMidgP71hnaktMibTRahQZhv5NqjM6ujzA9bxvUIhYT8m65qj47GxEc0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725316202; c=relaxed/simple; bh=wVFOFwNG96ZS5JTknDbiM35iEs7p1s20pBFB9wSWHWs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GTM7Cep+DWAA7sFL2tdLRMHXOZQAX1HLsMjRfuLcgafQ7i5/Y8Xq56SNu23K0fU83zk6eXjL8n1fzum6XvlvSn/WeDFUkvKoCPY/uDaqsTtNLa606zNsU7kT6jl9YE1c5bhIhkrX+c3llldVB3H46q5dphSL8K6mWu1b2k9Uw8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-25-87.elisa-laajakaista.fi [88.113.25.87]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id b6db18c5-697a-11ef-8e8a-005056bd6ce9; Tue, 03 Sep 2024 01:28:45 +0300 (EEST) From: Andy Shevchenko To: Jonathan Cameron , David Lechner , Andy Shevchenko , Michael Hennerich , Antoniu Miclaus , Jinjie Ruan , Lorenzo Bianconi , Srinivas Pandruvada , Basavaraj Natikar , linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiri Kosina , Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Andy Shevchenko Subject: [PATCH v1 20/22] iio: orientation: hid-sensor-rotation: Get platform data via dev_get_platdata() Date: Tue, 3 Sep 2024 01:17:05 +0300 Message-ID: <20240902222824.1145571-21-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902222824.1145571-1-andy.shevchenko@gmail.com> References: <20240902222824.1145571-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Andy Shevchenko Access to platform data via dev_get_platdata() getter to make code cleaner. Signed-off-by: Andy Shevchenko --- drivers/iio/orientation/hid-sensor-rotation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c index 5e8cadd5177a..107adadf7711 100644 --- a/drivers/iio/orientation/hid-sensor-rotation.c +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -230,11 +230,11 @@ static int dev_rot_parse_report(struct platform_device *pdev, /* Function to initialize the processing for usage id */ static int hid_dev_rot_probe(struct platform_device *pdev) { + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); int ret; char *name; struct iio_dev *indio_dev; struct dev_rot_state *rot_state; - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct dev_rot_state)); @@ -329,7 +329,7 @@ static int hid_dev_rot_probe(struct platform_device *pdev) /* Function to deinitialize the processing for usage id */ static void hid_dev_rot_remove(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct dev_rot_state *rot_state = iio_priv(indio_dev);