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: pressure: hid-sensor-press: 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-23-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
40a11278 cc10cbd6

+2 -2
+2 -2
drivers/iio/pressure/hid-sensor-press.c
··· 241 241 /* Function to initialize the processing for usage id */ 242 242 static int hid_press_probe(struct platform_device *pdev) 243 243 { 244 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 244 245 int ret = 0; 245 246 static const char *name = "press"; 246 247 struct iio_dev *indio_dev; 247 248 struct press_state *press_state; 248 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 249 249 250 250 indio_dev = devm_iio_device_alloc(&pdev->dev, 251 251 sizeof(struct press_state)); ··· 325 325 /* Function to deinitialize the processing for usage id */ 326 326 static void hid_press_remove(struct platform_device *pdev) 327 327 { 328 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 328 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 329 329 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 330 330 struct press_state *press_state = iio_priv(indio_dev); 331 331