mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
8627537ce0
commit
19eb29b05c
|
@ -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,
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue