Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: orientation: hid-sensor-rotation: Get platform data via dev_get_platdata()

Access to platform data via dev_get_platdata() getter to make code cleaner.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://patch.msgid.link/20240902222824.1145571-21-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
a6cf377a b1b2cda4

+2 -2
+2 -2
drivers/iio/orientation/hid-sensor-rotation.c
··· 230 230 /* Function to initialize the processing for usage id */ 231 231 static int hid_dev_rot_probe(struct platform_device *pdev) 232 232 { 233 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 233 234 int ret; 234 235 char *name; 235 236 struct iio_dev *indio_dev; 236 237 struct dev_rot_state *rot_state; 237 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 238 238 239 239 indio_dev = devm_iio_device_alloc(&pdev->dev, 240 240 sizeof(struct dev_rot_state)); ··· 329 329 /* Function to deinitialize the processing for usage id */ 330 330 static void hid_dev_rot_remove(struct platform_device *pdev) 331 331 { 332 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 332 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 333 333 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 334 334 struct dev_rot_state *rot_state = iio_priv(indio_dev); 335 335