Re: [PATCH v5 26/36] i2c: tegra: Factor out hardware initialization into separate function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 6, 2020 at 9:52 PM Dmitry Osipenko <digetx@xxxxxxxxx> wrote:
>
> Factor out hardware initialization into a separate function from the probe
> function. The only place where runtime PM needs to be resumed during probe
> is the place of hardware initialization, hence it makes sense to factor
> out it in order to have a bit cleaner error handling in tegra_i2c_probe().

...

> +static int tegra_i2c_init_hardware(struct tegra_i2c_dev *i2c_dev)
> +{
> +       int ret;
> +
> +       ret = pm_runtime_get_sync(i2c_dev->dev);
> +       if (ret < 0) {
> +               dev_err(i2c_dev->dev, "runtime resume failed: %d\n", ret);

refcount leak.

> +               return ret;
> +       }

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux