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: magnetometer: hid-sensor-magn-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-19-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
c2a12a1a e2f4b306

+2 -2
+2 -2
drivers/iio/magnetometer/hid-sensor-magn-3d.c
··· 466 466 /* Function to initialize the processing for usage id */ 467 467 static int hid_magn_3d_probe(struct platform_device *pdev) 468 468 { 469 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 469 470 int ret = 0; 470 471 static char *name = "magn_3d"; 471 472 struct iio_dev *indio_dev; 472 473 struct magn_3d_state *magn_state; 473 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 474 474 struct iio_chan_spec *channels; 475 475 int chan_count = 0; 476 476 ··· 549 549 /* Function to deinitialize the processing for usage id */ 550 550 static void hid_magn_3d_remove(struct platform_device *pdev) 551 551 { 552 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 552 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 553 553 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 554 554 struct magn_3d_state *magn_state = iio_priv(indio_dev); 555 555