Re: [PATCH] Add regulator driver for the bq2407x family of charger ICs

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

 



Am Dienstag 23 August 2011, 13:50:24 schrieb Mark Brown:
> On Sat, Aug 20, 2011 at 10:24:51PM +0200, Heiko Stübner wrote:
> 
> Mostly looks good, just a few fairly small comments below.
> 
> > +	if (pdata->max_uA && pdata->max_uA > 500000
> > +			      && max_uA >= pdata->max_uA) {
> > +		dev_dbg(rdev_get_dev(rdev),
> > +			"setting current limit to %d mA\n",
> > +			pdata->max_uA / 1000);
> > +		gpio_set_value(pdata->gpio_en2, 1);
> > +		gpio_set_value(pdata->gpio_en1, 0);
> > +	} else if (max_uA >= 500000) {
> > +		dev_dbg(rdev_get_dev(rdev),
> > +			"setting current limit to 500 mA\n");
> > +		gpio_set_value(pdata->gpio_en2, 0);
> > +		gpio_set_value(pdata->gpio_en1, 1);
> > +	} else if (max_uA >= 100000) {
> > +		dev_dbg(rdev_get_dev(rdev),
> > +			"setting current limit to 100 mA\n");
> > +		gpio_set_value(pdata->gpio_en2, 0);
> > +		gpio_set_value(pdata->gpio_en1, 0);
> > +	} else {
> > +		dev_dbg(rdev_get_dev(rdev),
> > +			"setting current limit to 0 mA\n");
> > +		gpio_set_value(pdata->gpio_en2, 1);
> > +		gpio_set_value(pdata->gpio_en1, 1);
> > +	}
> 
> I'd rather expect this to return an error sometimes.
gpio_set_value is a void function, so I'm not sure what could cause an error 
here.

Heiko
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm



[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux