Skip to content

Commit

Permalink
i2c: i2c-mux-gpio: Factor out pdev->dev in _probe_dt()
Browse files Browse the repository at this point in the history
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: Evan Green <evgreen@chromium.org>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
Evan Green authored and Wolfram Sang committed Jan 17, 2021
1 parent 8627537 commit 19eb29b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/i2c/muxes/i2c-mux-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
struct device_node *adapter_np, *child;
struct i2c_adapter *adapter;
Expand All @@ -77,11 +78,11 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,

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),
GFP_KERNEL);
if (!values) {
dev_err(&pdev->dev, "Cannot allocate values array");
dev_err(dev, "Cannot allocate values array");
return -ENOMEM;
}

Expand Down

0 comments on commit 19eb29b

Please sign in to comment.