Re: [PATCH 7/7] state: return -EPROBE_DEFER if the backend isn't available

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

 



Hello,

On Wed, May 13, 2015 at 12:12:32PM +0200, Marc Kleine-Budde wrote:
> From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
BTW, I didn't add this S-o-b on purpose because I didn't consider this
patch done.

> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> ---
>  drivers/misc/state.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/state.c b/drivers/misc/state.c
> index 9e8a40255348..dbe88715a103 100644
> --- a/drivers/misc/state.c
> +++ b/drivers/misc/state.c
> @@ -52,6 +52,8 @@ static int state_probe(struct device_d *dev)
>  	/* guess if of_path is a path, not a phandle */
>  	if (of_path[0] == '/') {
>  		ret = of_find_path(np, "backend", &path, 0);
> +		if (ret == -ENODEV)
> +			ret = -EPROBE_DEFER;
>  		if (ret)
>  			goto out_release;
>  	} else {
In my testcase I only use this hunk.

> @@ -66,7 +68,7 @@ static int state_probe(struct device_d *dev)
>  
>  		dev = of_find_device_by_node(partition_node);
>  		if (!list_is_singular(&dev->cdevs)) {
> -			ret = -ENODEV;
> +			ret = -EPROBE_DEFER;
>  			goto out_release;
>  		}
This one was done without testing, there is another if below that might
need adaption too (or instead of this one):

                cdev = list_first_entry(&dev->cdevs, struct cdev, devices_list);
                if (!cdev) {
                        ret = -ENODEV;
                        goto out_release;
                }

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux