RE: [PATCH 2/2] mmc: sdhci-of-aspeed: Add ast2700 support

Ryan Chen <[email protected]>
Newsgroups org.ozlabs.lists.openbmc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-mmc,org.ozlabs.lists.linux-aspeed
Message-ID <TY2PPF5CB9A1BE6CFB3FA0165159C68D3F0F242A@TY2PPF5CB9A1BE6.apcprd06.prod.outlook.com>
> Subject: RE: [PATCH 2/2] mmc: sdhci-of-aspeed: Add ast2700 support
> 
> > Subject: Re: [PATCH 2/2] mmc: sdhci-of-aspeed: Add ast2700 support
> >
> > On Fr, 2026-03-13 at 13:27 +0800, Ryan Chen wrote:
> > > Add support for the AST2700 SOC in the sd controller driver. AST2700
> > > sd controller requires an reset line, so hook up the optional reset
> > > control and deassert it during probe.
> > >
> > > Signed-off-by: Ryan Chen <[email protected]>
> > > ---
> > >  drivers/mmc/host/sdhci-of-aspeed.c | 11 +++++++++++
> > >  1 file changed, 11 insertions(+)
> > >
> > > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c
> > > b/drivers/mmc/host/sdhci-of-aspeed.c
> > > index ca97b01996b1..91c36245e506 100644
> > > --- a/drivers/mmc/host/sdhci-of-aspeed.c
> > > +++ b/drivers/mmc/host/sdhci-of-aspeed.c
> > > @@ -520,6 +520,7 @@ static int aspeed_sdc_probe(struct
> > > platform_device
> > > *pdev)
> > >
> > >  {
> > >  	struct device_node *parent, *child;
> > > +	struct reset_control *reset;
> > >  	struct aspeed_sdc *sdc;
> > >  	int ret;
> > >
> > > @@ -529,6 +530,15 @@ static int aspeed_sdc_probe(struct
> > > platform_device *pdev)
> > >
> > >  	spin_lock_init(&sdc->lock);
> > >
> > > +	reset = reset_control_get_optional_exclusive(&pdev->dev, NULL);
> >
> > This is missing a reset_control_put() in aspeed_sdc_remove(). Or use
> > devm_reset_control_get_optional_exclusive().
> >
> > Is it ok to assert this reset control in _remove()? If so, you could
> > use devm_reset_control_get_optional_exclusive_deasserted().
> >
> Thanks the guidance.
> I will update use
> sdc->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
> if (IS_ERR(sdc->rst))
> 	return dev_err_probe(&pdev->dev, PTR_ERR(sdc->rst),
> 			     "unable to acquire reset\n");
> 
Sorry, I review the devm_reset_control_get_optional_exclusive_deasserted
I will modify with following in probe.

	sdc->rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
									NULL);
	if (IS_ERR(sdc->rst))
		return dev_err_probe(&pdev->dev, PTR_ERR(sdc->rst),
				     "unable to acquire reset\n");

And add reset_control_assert(sdc->rst); in remove.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.