diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-04-13 11:36:23 +0200 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2023-04-13 16:27:42 +0200 |
commit | 9d793e7c1f884637c3bcd932b7a6ec9d976dccfb (patch) | |
tree | 40c81b7453bfcb8219aa3d17f73882489eb694c2 /drivers/hid/i2c-hid | |
parent | de4664485abbc0529b1eec44d0061bbfe58a28fb (diff) | |
download | linux-stable-9d793e7c1f884637c3bcd932b7a6ec9d976dccfb.tar.gz linux-stable-9d793e7c1f884637c3bcd932b7a6ec9d976dccfb.tar.bz2 linux-stable-9d793e7c1f884637c3bcd932b7a6ec9d976dccfb.zip |
HID: i2c-hid-of: Consistenly use dev local variable in probe()
i2c_hid_of_probe() has a dev local variable pointing to &i2c_client->dev,
consistently use this everywhere in i2c_hid_of_probe().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20230413093625.71146-2-hdegoede@redhat.com
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid-of.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid-of.c b/drivers/hid/i2c-hid/i2c-hid-of.c index 10176568133a..c82a5a54c3e6 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of.c +++ b/drivers/hid/i2c-hid/i2c-hid-of.c @@ -75,7 +75,7 @@ static int i2c_hid_of_probe(struct i2c_client *client) int ret; u32 val; - ihid_of = devm_kzalloc(&client->dev, sizeof(*ihid_of), GFP_KERNEL); + ihid_of = devm_kzalloc(dev, sizeof(*ihid_of), GFP_KERNEL); if (!ihid_of) return -ENOMEM; @@ -84,24 +84,21 @@ static int i2c_hid_of_probe(struct i2c_client *client) ret = of_property_read_u32(dev->of_node, "hid-descr-addr", &val); if (ret) { - dev_err(&client->dev, "HID register address not provided\n"); + dev_err(dev, "HID register address not provided\n"); return -ENODEV; } if (val >> 16) { - dev_err(&client->dev, "Bad HID register address: 0x%08x\n", - val); + dev_err(dev, "Bad HID register address: 0x%08x\n", val); return -EINVAL; } hid_descriptor_address = val; - if (!device_property_read_u32(&client->dev, "post-power-on-delay-ms", - &val)) + if (!device_property_read_u32(dev, "post-power-on-delay-ms", &val)) ihid_of->post_power_delay_ms = val; ihid_of->supplies[0].supply = "vdd"; ihid_of->supplies[1].supply = "vddl"; - ret = devm_regulator_bulk_get(&client->dev, - ARRAY_SIZE(ihid_of->supplies), + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ihid_of->supplies), ihid_of->supplies); if (ret) return ret; |