Re: [PATCH 1/2] input:Regulator support in ROHM BU21013 touch panel

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

 



On Wed, Jan 12, 2011 at 12:05:26PM +0530, Naveen Kumar G wrote:

> +	bu21013_data->regulator = regulator_get(&client->dev, "V-TOUCH");
> +	if (IS_ERR(bu21013_data->regulator)) {
> +		dev_warn(&client->dev, "regulator_get failed\n");
> +		bu21013_data->regulator = NULL;
> +	}
> +	if (bu21013_data->regulator)
> +		regulator_enable(bu21013_data->regulator);
> +

If you fail to acquire the regulator just return an error, there is
support in the regulator core for automatically providing a dummy
regulator (including in cases where some regulators are in use) so no
need to replicate this code in each driver or have lots of conditionals
for the regulator.

You're also not checking the result of regulator_enable().

>   */
>  struct bu21013_platform_device {
> +	const char *name;

As Dimitry said you should just use the dev_name() you get by default.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux