Skip to content

Commit 9d793e7

Browse files
jwrdegoedebentiss
authored andcommitted
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>
1 parent de46644 commit 9d793e7

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

drivers/hid/i2c-hid/i2c-hid-of.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int i2c_hid_of_probe(struct i2c_client *client)
7575
int ret;
7676
u32 val;
7777

78-
ihid_of = devm_kzalloc(&client->dev, sizeof(*ihid_of), GFP_KERNEL);
78+
ihid_of = devm_kzalloc(dev, sizeof(*ihid_of), GFP_KERNEL);
7979
if (!ihid_of)
8080
return -ENOMEM;
8181

@@ -84,24 +84,21 @@ static int i2c_hid_of_probe(struct i2c_client *client)
8484

8585
ret = of_property_read_u32(dev->of_node, "hid-descr-addr", &val);
8686
if (ret) {
87-
dev_err(&client->dev, "HID register address not provided\n");
87+
dev_err(dev, "HID register address not provided\n");
8888
return -ENODEV;
8989
}
9090
if (val >> 16) {
91-
dev_err(&client->dev, "Bad HID register address: 0x%08x\n",
92-
val);
91+
dev_err(dev, "Bad HID register address: 0x%08x\n", val);
9392
return -EINVAL;
9493
}
9594
hid_descriptor_address = val;
9695

97-
if (!device_property_read_u32(&client->dev, "post-power-on-delay-ms",
98-
&val))
96+
if (!device_property_read_u32(dev, "post-power-on-delay-ms", &val))
9997
ihid_of->post_power_delay_ms = val;
10098

10199
ihid_of->supplies[0].supply = "vdd";
102100
ihid_of->supplies[1].supply = "vddl";
103-
ret = devm_regulator_bulk_get(&client->dev,
104-
ARRAY_SIZE(ihid_of->supplies),
101+
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ihid_of->supplies),
105102
ihid_of->supplies);
106103
if (ret)
107104
return ret;

0 commit comments

Comments
 (0)