Commit 9d793e7c authored by Hans de Goede's avatar Hans de Goede Committed by Benjamin Tissoires

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: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20230413093625.71146-2-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
parent de466448
...@@ -75,7 +75,7 @@ static int i2c_hid_of_probe(struct i2c_client *client) ...@@ -75,7 +75,7 @@ static int i2c_hid_of_probe(struct i2c_client *client)
int ret; int ret;
u32 val; 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) if (!ihid_of)
return -ENOMEM; return -ENOMEM;
...@@ -84,24 +84,21 @@ static int i2c_hid_of_probe(struct i2c_client *client) ...@@ -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); ret = of_property_read_u32(dev->of_node, "hid-descr-addr", &val);
if (ret) { if (ret) {
dev_err(&client->dev, "HID register address not provided\n"); dev_err(dev, "HID register address not provided\n");
return -ENODEV; return -ENODEV;
} }
if (val >> 16) { if (val >> 16) {
dev_err(&client->dev, "Bad HID register address: 0x%08x\n", dev_err(dev, "Bad HID register address: 0x%08x\n", val);
val);
return -EINVAL; return -EINVAL;
} }
hid_descriptor_address = val; hid_descriptor_address = val;
if (!device_property_read_u32(&client->dev, "post-power-on-delay-ms", if (!device_property_read_u32(dev, "post-power-on-delay-ms", &val))
&val))
ihid_of->post_power_delay_ms = val; ihid_of->post_power_delay_ms = val;
ihid_of->supplies[0].supply = "vdd"; ihid_of->supplies[0].supply = "vdd";
ihid_of->supplies[1].supply = "vddl"; ihid_of->supplies[1].supply = "vddl";
ret = devm_regulator_bulk_get(&client->dev, ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ihid_of->supplies),
ARRAY_SIZE(ihid_of->supplies),
ihid_of->supplies); ihid_of->supplies);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment