Commit 19eb29b0 authored by Evan Green's avatar Evan Green Committed by Wolfram Sang

i2c: i2c-mux-gpio: Factor out pdev->dev in _probe_dt()

Factor out &pdev->dev into a local variable in preparation for
the ACPI enablement of this function, which will utilize the variable
more.
Signed-off-by: default avatarEvan Green <evgreen@chromium.org>
Acked-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 8627537c
...@@ -53,6 +53,7 @@ static int i2c_mux_gpio_deselect(struct i2c_mux_core *muxc, u32 chan) ...@@ -53,6 +53,7 @@ static int i2c_mux_gpio_deselect(struct i2c_mux_core *muxc, u32 chan)
static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct device_node *adapter_np, *child; struct device_node *adapter_np, *child;
struct i2c_adapter *adapter; struct i2c_adapter *adapter;
...@@ -77,11 +78,11 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, ...@@ -77,11 +78,11 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
mux->data.n_values = of_get_child_count(np); mux->data.n_values = of_get_child_count(np);
values = devm_kcalloc(&pdev->dev, values = devm_kcalloc(dev,
mux->data.n_values, sizeof(*mux->data.values), mux->data.n_values, sizeof(*mux->data.values),
GFP_KERNEL); GFP_KERNEL);
if (!values) { if (!values) {
dev_err(&pdev->dev, "Cannot allocate values array"); dev_err(dev, "Cannot allocate values array");
return -ENOMEM; return -ENOMEM;
} }
......
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