devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Ezequiel Garcia
	<ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
	Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Andrew Bresticker
	<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	James Hartley
	<james.hartley-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
	Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Pawel.Moll-5wv7dgnIgG8@public.gmane.org,
	Mark.Rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	Naidu.Tellapati-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org,
	Phani Movva <Phani.Movva-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v3 1/3] iio: adc: Cosmic Circuits 10001 ADC driver
Date: Thu, 27 Nov 2014 16:16:58 +0100	[thread overview]
Message-ID: <5477406A.8020403@metafoo.de> (raw)
In-Reply-To: <54773E63.4020300-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>

[...]
>>>
>>>>>>> +
>>>>>>> +	adc_dev->reg = devm_regulator_get(&pdev->dev, "vref");
>>>>>>> +	if (IS_ERR_OR_NULL(adc_dev->reg))
>>>>>>> +		return -EINVAL;
>>>>>> 	if (IS_ERR(adc_dev->reg))
>>>>>> 		return PTR_ERR(adc_dev->reg);
>>>>>
>>>>> Are you sure? What if devm_regulator_get() returns NULL?
>>>>>
>>>> I had a look at it, but couldn't figure out a condition in which it would return NULL. But I'd be happy to be informed of anything different.
>>>
>>> If CONFIG_REGULATOR=n you get NULL there (although I added a select REGULATOR
>>> on the v4 I just posted).
>>>
>> Indeed, thanks. Now I'm thinking if it would make sense to handle this special case in a special way (as it would be caused by an invalid kernel config). Well, I guess, I leave it up to you.
>
> Well, adding the select REGULATOR that shouldn't happen, so let's better
> drop the NULL check entirely.

Doing a 'select REGULATOR' can (and probably will sooner or later) create 
nasty dependency loops. User selectable config items should not be selected 
by another config item. If the driver really has a hard dependency on the 
regulator framework then 'depends on REGULATOR' is the right thing to do.

- Lars

  parent reply	other threads:[~2014-11-27 15:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 14:13 [PATCH v3 0/3] iio: Add Cosmic Circuits ADC support Ezequiel Garcia
     [not found] ` <1415888044-16635-1-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-13 14:13   ` [PATCH v3 1/3] iio: adc: Cosmic Circuits 10001 ADC driver Ezequiel Garcia
     [not found]     ` <1415888044-16635-2-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-15 10:46       ` Jonathan Cameron
     [not found]         ` <54672F04.40201-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-11-15 18:05           ` Ezequiel Garcia
2014-11-22  1:15       ` Hartmut Knaack
     [not found]         ` <546FE3A7.6040308-Mmb7MZpHnFY@public.gmane.org>
2014-11-25 17:46           ` Ezequiel Garcia
     [not found]             ` <5474C062.2020604-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-25 21:41               ` Hartmut Knaack
     [not found]                 ` <5474F7A5.6030008-Mmb7MZpHnFY@public.gmane.org>
2014-11-25 22:03                   ` Ezequiel Garcia
     [not found]                     ` <5474FCC8.8080906-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-25 22:53                       ` Hartmut Knaack
     [not found]                         ` <5475085E.8090806-Mmb7MZpHnFY@public.gmane.org>
2014-11-27 15:08                           ` Ezequiel Garcia
     [not found]                             ` <54773E63.4020300-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-27 15:16                               ` Lars-Peter Clausen [this message]
     [not found]                                 ` <5477406A.8020403-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2014-11-27 15:18                                   ` Ezequiel Garcia
2014-11-13 14:13   ` [PATCH v3 2/3] DT: iio: adc: Add CC_10001 binding documentation Ezequiel Garcia
     [not found]     ` <1415888044-16635-3-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-13 14:37       ` Rob Herring
     [not found]         ` <CAL_JsqK=F36EweJyWKemYn=5TbzKWv3xLFfhbfQ1bvQKR6tQLQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-13 18:18           ` Ezequiel Garcia
2014-11-13 18:19       ` [PATCH v4 " Ezequiel Garcia
2014-11-13 14:14   ` [PATCH v3 3/3] DT: Add a vendor prefix for Cosmic Circuits Ezequiel Garcia
     [not found]     ` <1415888044-16635-4-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-13 14:34       ` Rob Herring
2014-11-13 14:14   ` [PATCH v3 0/3] iio: Add Cosmic Circuits ADC support Ezequiel Garcia
     [not found]     ` <1415888044-16635-5-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-13 19:10       ` Andrew Bresticker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5477406A.8020403@metafoo.de \
    --to=lars-qo5elluwu/uelga04laivw@public.gmane.org \
    --cc=Mark.Rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=Naidu.Tellapati-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
    --cc=Pawel.Moll-5wv7dgnIgG8@public.gmane.org \
    --cc=Phani.Movva-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
    --cc=abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=james.hartley-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
    --cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).