diff mbox

[7/8] mwifiex: don't print an error if an optional DT property is missing

Message ID 1464358702-19083-8-git-send-email-javier@osg.samsung.com (mailing list archive)
State Accepted
Commit 806dd220340d404857c2f1b8f4bd9f9f1f052d80
Delegated to: Kalle Valo
Headers show

Commit Message

Javier Martinez Canillas May 27, 2016, 2:18 p.m. UTC
The Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt DT
binding document say that the "interrupts" property in the child node is
optional. So the property being missed shouldn't be treated as an error.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Julian Calaby June 1, 2016, 4:20 a.m. UTC | #1
Hi All,

On Sat, May 28, 2016 at 12:18 AM, Javier Martinez Canillas
<javier@osg.samsung.com> wrote:
> The Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt DT
> binding document say that the "interrupts" property in the child node is
> optional. So the property being missed shouldn't be treated as an error.

Have you checked whether it is truly optional? I.e. nothing else
breaks if this property isn't set?

> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

Other than that, this looks sensible to me.

Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

> ---
>
>  drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,
Javier Martinez Canillas June 1, 2016, 1:51 p.m. UTC | #2
Hello Julian,

Thanks a lot for your feedback and reviews.

On 06/01/2016 12:20 AM, Julian Calaby wrote:
> Hi All,
> 
> On Sat, May 28, 2016 at 12:18 AM, Javier Martinez Canillas
> <javier@osg.samsung.com> wrote:
>> The Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt DT
>> binding document say that the "interrupts" property in the child node is
>> optional. So the property being missed shouldn't be treated as an error.
> 
> Have you checked whether it is truly optional? I.e. nothing else
> breaks if this property isn't set?
>

That's what the DT binding says and the IRQ is only used as a wakeup source
during system suspend, it is not used during runtime. And that is why the
mwifiex_sdio_probe_of() function does not fail if the IRQ is missing.

Now, I just got to that conclusion by reading the binding docs, the message
in the commits that introduced this and the driver code. Xinming Hu should
comment on how critical this feature is for systems that needs to be wakeup.

In any case I think that the code should be consistent with what the binding
doc says and also the function does (i.e: dev_err only if returns an error).
 
>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> Other than that, this looks sensible to me.
> 
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
> 

Best regards,
Julian Calaby June 1, 2016, 11:13 p.m. UTC | #3
Hi Javier,

On Wed, Jun 1, 2016 at 11:51 PM, Javier Martinez Canillas
<javier@osg.samsung.com> wrote:
> Hello Julian,
>
> Thanks a lot for your feedback and reviews.
>
> On 06/01/2016 12:20 AM, Julian Calaby wrote:
>> Hi All,
>>
>> On Sat, May 28, 2016 at 12:18 AM, Javier Martinez Canillas
>> <javier@osg.samsung.com> wrote:
>>> The Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt DT
>>> binding document say that the "interrupts" property in the child node is
>>> optional. So the property being missed shouldn't be treated as an error.
>>
>> Have you checked whether it is truly optional? I.e. nothing else
>> breaks if this property isn't set?
>>
>
> That's what the DT binding says and the IRQ is only used as a wakeup source
> during system suspend, it is not used during runtime. And that is why the
> mwifiex_sdio_probe_of() function does not fail if the IRQ is missing.

Awesome, that's what I wanted to know.

> Now, I just got to that conclusion by reading the binding docs, the message
> in the commits that introduced this and the driver code. Xinming Hu should
> comment on how critical this feature is for systems that needs to be wakeup.

Xinming, could you review this also?

> In any case I think that the code should be consistent with what the binding
> doc says and also the function does (i.e: dev_err only if returns an error).
>
>>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>>
>> Other than that, this looks sensible to me.
>>
>> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
>>
>
> Best regards,

Thanks,
Amitkumar Karwar June 9, 2016, 1:51 p.m. UTC | #4
> From: Julian Calaby [mailto:julian.calaby@gmail.com]

> Sent: Thursday, June 02, 2016 4:44 AM

> To: Javier Martinez Canillas; Xinming Hu

> Cc: linux-kernel@vger.kernel.org; Amitkumar Karwar; Kalle Valo; netdev;

> linux-wireless; Nishant Sarmukadam

> Subject: Re: [PATCH 7/8] mwifiex: don't print an error if an optional DT

> property is missing

> 

> Hi Javier,

> 

> On Wed, Jun 1, 2016 at 11:51 PM, Javier Martinez Canillas

> <javier@osg.samsung.com> wrote:

> > Hello Julian,

> >

> > Thanks a lot for your feedback and reviews.

> >

> > On 06/01/2016 12:20 AM, Julian Calaby wrote:

> >> Hi All,

> >>

> >> On Sat, May 28, 2016 at 12:18 AM, Javier Martinez Canillas

> >> <javier@osg.samsung.com> wrote:

> >>> The

> >>> Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt DT

> >>> binding document say that the "interrupts" property in the child

> node is optional. So the property being missed shouldn't be treated as

> an error.

> >>

> >> Have you checked whether it is truly optional? I.e. nothing else

> >> breaks if this property isn't set?

> >>

> >

> > That's what the DT binding says and the IRQ is only used as a wakeup

> > source during system suspend, it is not used during runtime. And that

> > is why the

> > mwifiex_sdio_probe_of() function does not fail if the IRQ is missing.

> 

> Awesome, that's what I wanted to know.

> 

> > Now, I just got to that conclusion by reading the binding docs, the

> > message in the commits that introduced this and the driver code.

> > Xinming Hu should comment on how critical this feature is for systems

> that needs to be wakeup.

> 

> Xinming, could you review this also?

> 


Yes. IRQ is the optional parameter. System has a flexibility to not use it, but it still can configure other device tree parameters. The patch looks good.

Regards,
Amitkumar
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 1c17e624547a..8b3292eaecb2 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -114,7 +114,7 @@  static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card)
 	if (cfg && card->plt_of_node) {
 		cfg->irq_wifi = irq_of_parse_and_map(card->plt_of_node, 0);
 		if (!cfg->irq_wifi) {
-			dev_err(dev,
+			dev_dbg(dev,
 				"fail to parse irq_wifi from device tree\n");
 		} else {
 			ret = devm_request_irq(dev, cfg->irq_wifi,