[v1] iio: accel: st_accel: Use st_sensors_dev_name_probe()
diff mbox series

Message ID 20200120092550.39427-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series
  • [v1] iio: accel: st_accel: Use st_sensors_dev_name_probe()
Related show

Commit Message

Andy Shevchenko Jan. 20, 2020, 9:25 a.m. UTC
Use st_sensors_dev_name_probe() instead open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/accel/st_accel_i2c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Jonathan Cameron Jan. 29, 2020, 8:38 p.m. UTC | #1
On Mon, 20 Jan 2020 11:25:50 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Use st_sensors_dev_name_probe() instead open coded variant.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to start poking at it.

Thanks,

Jonathan

> ---
>  drivers/iio/accel/st_accel_i2c.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
> index 633955d764cc..8c489312f668 100644
> --- a/drivers/iio/accel/st_accel_i2c.c
> +++ b/drivers/iio/accel/st_accel_i2c.c
> @@ -147,12 +147,9 @@ static int st_accel_i2c_probe(struct i2c_client *client)
>  	const struct st_sensor_settings *settings;
>  	struct st_sensor_data *adata;
>  	struct iio_dev *indio_dev;
> -	const char *match;
>  	int ret;
>  
> -	match = device_get_match_data(&client->dev);
> -	if (match)
> -		strlcpy(client->name, match, sizeof(client->name));
> +	st_sensors_dev_name_probe(&client->dev, client->name, sizeof(client->name));
>  
>  	settings = st_accel_get_settings(client->name);
>  	if (!settings) {

Patch
diff mbox series

diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index 633955d764cc..8c489312f668 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -147,12 +147,9 @@  static int st_accel_i2c_probe(struct i2c_client *client)
 	const struct st_sensor_settings *settings;
 	struct st_sensor_data *adata;
 	struct iio_dev *indio_dev;
-	const char *match;
 	int ret;
 
-	match = device_get_match_data(&client->dev);
-	if (match)
-		strlcpy(client->name, match, sizeof(client->name));
+	st_sensors_dev_name_probe(&client->dev, client->name, sizeof(client->name));
 
 	settings = st_accel_get_settings(client->name);
 	if (!settings) {