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: light: hid-sensor-prox: 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-17-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
d72be90a a5b2f654

+2 -2
+2 -2
drivers/iio/light/hid-sensor-prox.c
··· 233 233 /* Function to initialize the processing for usage id */ 234 234 static int hid_prox_probe(struct platform_device *pdev) 235 235 { 236 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 236 237 int ret = 0; 237 238 static const char *name = "prox"; 238 239 struct iio_dev *indio_dev; 239 240 struct prox_state *prox_state; 240 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 241 241 242 242 indio_dev = devm_iio_device_alloc(&pdev->dev, 243 243 sizeof(struct prox_state)); ··· 315 315 /* Function to deinitialize the processing for usage id */ 316 316 static void hid_prox_remove(struct platform_device *pdev) 317 317 { 318 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 318 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 319 319 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 320 320 struct prox_state *prox_state = iio_priv(indio_dev); 321 321