summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorEvan Green <evgreen@chromium.org>2020-11-19 02:40:24 +0300
committerWolfram Sang <wsa@kernel.org>2021-01-17 14:52:49 +0300
commit19eb29b05cc6dd6842ddc475a45da6723428e927 (patch)
tree6bdb1ffb35d188f94b55e4655dcf49db9a988139 /drivers/i2c
parent8627537ce04483641ca783c10578d0fb33bd239a (diff)
downloadlinux-19eb29b05cc6dd6842ddc475a45da6723428e927.tar.xz
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: Evan Green <evgreen@chromium.org> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/muxes/i2c-mux-gpio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 4effe563e9e8..caaa782b50d8 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -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;
@@ -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;
}