diff mbox

[v2,3/3] mfd: mt6397: check the EPROBE_DEFER from platform_get_irq.

Message ID 1460098729-25549-3-git-send-email-henryc.chen@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Henry Chen April 8, 2016, 6:58 a.m. UTC
If get the -EPROBE_DEFER from platform_get_irq, it should return back directly.

Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
---
 drivers/mfd/mt6397-core.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Lee Jones April 11, 2016, 8:50 a.m. UTC | #1
On Fri, 08 Apr 2016, Henry Chen wrote:

> If get the -EPROBE_DEFER from platform_get_irq, it should return back directly.
> 
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
>  drivers/mfd/mt6397-core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> index 15050cb..b9b1e28 100644
> --- a/drivers/mfd/mt6397-core.c
> +++ b/drivers/mfd/mt6397-core.c
> @@ -271,6 +271,8 @@ static int mt6397_probe(struct platform_device *pdev)
>  	}
>  
>  	pmic->irq = platform_get_irq(pdev, 0);
> +	if (pmic->irq == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;

if (ret < 0)
   return ret;

... is more common, as it covers more bases, etc.

>  	switch (id & 0xff) {
>  	case MT6323_CID_CODE:
Henry Chen April 13, 2016, 5:48 a.m. UTC | #2
On Mon, 2016-04-11 at 09:50 +0100, Lee Jones wrote:
> On Fri, 08 Apr 2016, Henry Chen wrote:
> 
> > If get the -EPROBE_DEFER from platform_get_irq, it should return back directly.
> > 
> > Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> > ---
> >  drivers/mfd/mt6397-core.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> > index 15050cb..b9b1e28 100644
> > --- a/drivers/mfd/mt6397-core.c
> > +++ b/drivers/mfd/mt6397-core.c
> > @@ -271,6 +271,8 @@ static int mt6397_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	pmic->irq = platform_get_irq(pdev, 0);
> > +	if (pmic->irq == -EPROBE_DEFER)
> > +		return -EPROBE_DEFER;
> 
> if (ret < 0)
>    return ret;
> 
> ... is more common, as it covers more bases, etc.

Okay, the interrupt should be a required properties, if get failed just
return back.

I will also change the binding doc.

Thanks.

> 
> >  	switch (id & 0xff) {
> >  	case MT6323_CID_CODE:
>
diff mbox

Patch

diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 15050cb..b9b1e28 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -271,6 +271,8 @@  static int mt6397_probe(struct platform_device *pdev)
 	}
 
 	pmic->irq = platform_get_irq(pdev, 0);
+	if (pmic->irq == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
 
 	switch (id & 0xff) {
 	case MT6323_CID_CODE: