Re: [PATCH v4 05/10] power: bq24257: Add SW-based approach for Power Good determination

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

 




On Wed, Sep 16, 2015 at 02:41:13PM +0900, Krzysztof Kozlowski wrote:
> On 16.09.2015 02:58, Andreas Dannenberg wrote:
> > @@ -676,7 +696,7 @@ static int bq24257_pg_gpio_probe(struct bq24257_device *bq)
> >  {
> >  	bq->pg = devm_gpiod_get_index(bq->dev, BQ24257_PG_GPIO, 0, GPIOD_IN);
> >  	if (IS_ERR(bq->pg)) {
> > -		dev_err(bq->dev, "could not probe PG pin\n");
> > +		dev_info(bq->dev, "could not probe PG pin\n");
> 
> I think if pg-gpio is provided (e.g. by DTS) but it is invalid (return
> value != ENOENT) then it is an error you could print. The driver will
> fallback to the software method but still user/developer may want to
> notice the error (e.g. error in DTS).
> 
> Anyway it is up to you, rest looks good:

Krzysztof,
I looked at this closer and all the error scenarios I could come up with
to test regarding the pin definition in DT (wrong pin numbers, missing
definition altogether) all generated an -ENOENT coming out of
devm_gpiod_get_index() with no differentiation between the cases. I'm
sure there is some way to accomplish that but for the time being I left
the refinement between dev_err() and dev_info() alone.

Regards,

--
Andreas Dannenberg
Texas Instruments Inc

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux