diff mbox series

[03/19] mmc: call device_probe() after scanning

Message ID 20220202010853.40405-4-takahiro.akashi@linaro.org
State Superseded
Headers show
Series efi_loader: more tightly integrate UEFI disks to driver model | expand

Commit Message

AKASHI Takahiro Feb. 2, 2022, 1:08 a.m. UTC
Every time a mmc bus/port is scanned and a new device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 drivers/mmc/mmc-uclass.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Jaehoon Chung Feb. 8, 2022, 11:46 p.m. UTC | #1
On 2/2/22 10:08, AKASHI Takahiro wrote:
> Every time a mmc bus/port is scanned and a new device is detected,
> we want to call device_probe() as it will give us a chance to run
> additional post-processings for some purposes.
> 
> In particular, support for creating partitions on a device will be added.
> 
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>  drivers/mmc/mmc-uclass.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
> index b80e838066ca..e918f58a212e 100644
> --- a/drivers/mmc/mmc-uclass.c
> +++ b/drivers/mmc/mmc-uclass.c
> @@ -467,6 +467,18 @@ static int mmc_blk_probe(struct udevice *dev)
>  		return ret;
>  	}
>  
> +	ret = device_probe(dev);
> +	if (ret) {
> +		debug("Can't probe\n");

how about displaying return value to debug?

Best Regards,
Jaehoon Chung

> +
> +		if (IS_ENABLED(CONFIG_MMC_UHS_SUPPORT) ||
> +		    IS_ENABLED(CONFIG_MMC_HS200_SUPPORT) ||
> +		    IS_ENABLED(CONFIG_MMC_HS400_SUPPORT))
> +			mmc_deinit(mmc);
> +
> +		return ret;
> +	}
> +
>  	return 0;
>  }
>
AKASHI Takahiro Feb. 10, 2022, 3:45 a.m. UTC | #2
On Wed, Feb 09, 2022 at 08:46:18AM +0900, Jaehoon Chung wrote:
> On 2/2/22 10:08, AKASHI Takahiro wrote:
> > Every time a mmc bus/port is scanned and a new device is detected,
> > we want to call device_probe() as it will give us a chance to run
> > additional post-processings for some purposes.
> > 
> > In particular, support for creating partitions on a device will be added.
> > 
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> >  drivers/mmc/mmc-uclass.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
> > index b80e838066ca..e918f58a212e 100644
> > --- a/drivers/mmc/mmc-uclass.c
> > +++ b/drivers/mmc/mmc-uclass.c
> > @@ -467,6 +467,18 @@ static int mmc_blk_probe(struct udevice *dev)
> >  		return ret;
> >  	}
> >  
> > +	ret = device_probe(dev);
> > +	if (ret) {
> > +		debug("Can't probe\n");
> 
> how about displaying return value to debug?

Sure.

-Takahiro Akashi

> Best Regards,
> Jaehoon Chung
> 
> > +
> > +		if (IS_ENABLED(CONFIG_MMC_UHS_SUPPORT) ||
> > +		    IS_ENABLED(CONFIG_MMC_HS200_SUPPORT) ||
> > +		    IS_ENABLED(CONFIG_MMC_HS400_SUPPORT))
> > +			mmc_deinit(mmc);
> > +
> > +		return ret;
> > +	}
> > +
> >  	return 0;
> >  }
> >  
>
diff mbox series

Patch

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index b80e838066ca..e918f58a212e 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -467,6 +467,18 @@  static int mmc_blk_probe(struct udevice *dev)
 		return ret;
 	}
 
+	ret = device_probe(dev);
+	if (ret) {
+		debug("Can't probe\n");
+
+		if (IS_ENABLED(CONFIG_MMC_UHS_SUPPORT) ||
+		    IS_ENABLED(CONFIG_MMC_HS200_SUPPORT) ||
+		    IS_ENABLED(CONFIG_MMC_HS400_SUPPORT))
+			mmc_deinit(mmc);
+
+		return ret;
+	}
+
 	return 0;
 }