OSDN Git Service

iio: st_pressure: st_accel: Initialise sensor platform data properly
authorShrirang Bagul <shrirang.bagul@canonical.com>
Wed, 19 Apr 2017 14:05:00 +0000 (22:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:00:15 +0000 (11:00 +0100)
commit19b0f2fad8ceb65480e8faf5cb8f7de015b94655
treea95209db26dcf33939c9a9b413f2141a0ad9818d
parentb5684e7a731d04dee1a2e9b76e5aba228647d5f9
iio: st_pressure: st_accel: Initialise sensor platform data properly

[ Upstream commit 7383d44b84c94aaca4bf695a6bd8a69f2295ef1a ]

This patch fixes the sensor platform data initialisation for st_pressure
and st_accel device drivers. Without this patch, the driver fails to
register the sensors when the user removes and re-loads the driver.

1. Unload the kernel modules for st_pressure
$ sudo rmmod st_pressure_i2c
$ sudo rmmod st_pressure

2. Re-load the driver
$ sudo insmod st_pressure
$ sudo insmod st_pressure_i2c

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/accel/st_accel_core.c
drivers/iio/pressure/st_pressure_core.c