diff mbox

mtd: nand: orion: don't complain for probe deferral

Message ID 20170502000455.13240-5-computersforpeace@gmail.com
State Rejected
Delegated to: Brian Norris
Headers show

Commit Message

Brian Norris May 2, 2017, 12:04 a.m. UTC
Recent patches to this driver changed the error handling for missing
clocks. Now we'll print an error if the clock causes us to defer
probing. Let's not do that.

Cc: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
Compile tested only

 drivers/mtd/nand/orion_nand.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Boris Brezillon May 2, 2017, 7:56 a.m. UTC | #1
On Mon,  1 May 2017 17:04:54 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> Recent patches to this driver changed the error handling for missing
> clocks. Now we'll print an error if the clock causes us to defer
> probing. Let's not do that.
> 
> Cc: Simon Baatz <gmbnomis@gmail.com>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
> Compile tested only
> 
>  drivers/mtd/nand/orion_nand.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index f8e463a97b9e..e2bfb37f11df 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -161,7 +161,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
>  		if (ret == -ENOENT) {
>  			info->clk = NULL;
>  		} else {
> -			dev_err(&pdev->dev, "failed to get clock!\n");
> +			if (ret != -EPROBE_DEFER)
> +				dev_err(&pdev->dev, "failed to get clock!\n");
>  			return ret;
>  		}
>  	}
Simon Baatz May 2, 2017, 8:07 a.m. UTC | #2
Hi Brian,

On Mon, May 01, 2017 at 05:04:54PM -0700, Brian Norris wrote:
> Recent patches to this driver changed the error handling for missing
> clocks. Now we'll print an error if the clock causes us to defer
> probing. Let's not do that.
> 

This is by intention.  Probe deferral is not supported by drivers
using module_platform_driver_probe().  EPROBE_DEFER results in not
being able to get the clock and, thus, is handled like any other
error.


- Simon
Brian Norris May 8, 2017, 5:46 p.m. UTC | #3
On Tue, May 02, 2017 at 10:07:31AM +0200, Simon Baatz wrote:
> Hi Brian,
> 
> On Mon, May 01, 2017 at 05:04:54PM -0700, Brian Norris wrote:
> > Recent patches to this driver changed the error handling for missing
> > clocks. Now we'll print an error if the clock causes us to defer
> > probing. Let's not do that.
> > 
> 
> This is by intention.  Probe deferral is not supported by drivers
> using module_platform_driver_probe().  EPROBE_DEFER results in not
> being able to get the clock and, thus, is handled like any other
> error.

Ah, good point. I overlooked that part.

Seems kind of inconsistent driver writing (what happens if someone wants
to use this driver on a more complex system, where some of the dependent
resources are not available at init time?), but I see in the git logs
that apparently this is intentional (to save memory?).

So, I'll NAK this patch.

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index f8e463a97b9e..e2bfb37f11df 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -161,7 +161,8 @@  static int __init orion_nand_probe(struct platform_device *pdev)
 		if (ret == -ENOENT) {
 			info->clk = NULL;
 		} else {
-			dev_err(&pdev->dev, "failed to get clock!\n");
+			if (ret != -EPROBE_DEFER)
+				dev_err(&pdev->dev, "failed to get clock!\n");
 			return ret;
 		}
 	}