Commit graph

7 commits

Author SHA1 Message Date
Wolfram Sang a1671af286 i2c: of: simplify reading the "reg" property
of_get_property() is a bit cumbersome to use. Replace it with the newer
of_property_read_u32() for more readable code.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-02-26 20:40:46 +01:00
Wolfram Sang 4f3ae38acb i2c: of: remove duplicated check for valid address
The very same check is done when calling i2c_new_device(). Remove it
here to avoid code duplication.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-02-26 20:40:46 +01:00
Wolfram Sang c49b0e0775 i2c: of: rename variable to meet expectations
'result' is mostly used in the kernel as int for functions returning
errno on failure. Here it is a pointer to the client struct, so let's
call it this way (as the parent function does, too).

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-02-26 20:40:46 +01:00
Wolfram Sang e6db2d3278 i2c: of: make ref counting more visible
When debugging a ref counting problem, I overlooked this snipplet a few
times. Might be taste, but I think the new location is visually easier
recognizable.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-02-26 20:40:46 +01:00
Wolfram Sang f1c87ceb02 i2c: of: change log level of failed device creation
If we cannot create a device, this is an error, not a warning. Fix the
log level.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-02-26 20:40:46 +01:00
Rob Herring 453a237ccf i2c: Convert to using %pOF instead of full_name
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31 17:19:35 +02:00
Wolfram Sang 5bf4fa7dae i2c: break out OF support into separate file
Also removes some ifdeffery.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-05-31 21:01:04 +02:00