Re: [PATCH] gpio: pca953x: Use i2c_get_match_data()

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

 



On Sat, Aug 19, 2023 at 06:37:47PM +0100, Biju Das wrote:
> Replace device_get_match_data() and id lookup for retrieving match data
> by i2c_get_match_data().

...

> -	if (i2c_id) {
> -		chip->driver_data = i2c_id->driver_data;
> -	} else {
> -		const void *match;
> -
> -		match = device_get_match_data(&client->dev);
> -		if (!match) {
> -			ret = -ENODEV;
> -			goto err_exit;
> -		}
> -
> -		chip->driver_data = (uintptr_t)match;
> +	chip->driver_data = (uintptr_t)i2c_get_match_data(client);
> +	if (!chip->driver_data) {
> +		ret = -ENODEV;
> +		goto err_exit;
>  	}

Can you move this to be called before devm_regulator_get()? It doesn't require
regulator to be enabled for functioning.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux