lkml.org 
[lkml]   [2018]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 1/2] IIO: st_accel_i2c.c: Simplify access to driver data
On Tue, Jul 3, 2018 at 8:41 AM, Nikolaus Voss
<nikolaus.voss@loewensteinmedical.de> wrote:
> Use device_get_match_data API to simplify access to driver data.

..._data()

But. You actually don't use it below.

> Let acpi_device_id table entries point to the same driver data as
> of_device_id table entries and uniquify access to driver data by using
> device_get_match_data API.

> #include <linux/acpi.h>
> #include <linux/i2c.h>
> #include <linux/iio/iio.h>

> +#include <linux/of_device.h>

(linux/property.h)

> + match = of_device_get_match_data(&client->dev);
> + if (!match)
> + match = acpi_device_get_match_data(&client->dev);

What I meant is to simply call

match = device_get_match_data(...);

> + if (match)
> + strlcpy(client->name, match, sizeof(client->name));

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-07-03 23:08    [W:0.127 / U:3.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site