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: gyro: hid-sensor-gyro-3d: 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-14-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
80253ed8 602711d5

+2 -2
+2 -2
drivers/iio/gyro/hid-sensor-gyro-3d.c
··· 279 279 /* Function to initialize the processing for usage id */ 280 280 static int hid_gyro_3d_probe(struct platform_device *pdev) 281 281 { 282 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 282 283 int ret = 0; 283 284 static const char *name = "gyro_3d"; 284 285 struct iio_dev *indio_dev; 285 286 struct gyro_3d_state *gyro_state; 286 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 287 287 288 288 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*gyro_state)); 289 289 if (!indio_dev) ··· 361 361 /* Function to deinitialize the processing for usage id */ 362 362 static void hid_gyro_3d_remove(struct platform_device *pdev) 363 363 { 364 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 364 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 365 365 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 366 366 struct gyro_3d_state *gyro_state = iio_priv(indio_dev); 367 367