lkml.org 
[lkml]   [2021]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] mmc: core: Added support for LED trigger only when SD card is connected
Date
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index
> > f194940c5974..b3156f6c5cfa 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -352,7 +352,11 @@ int mmc_start_request(struct mmc_host *host,
> struct mmc_request *mrq)
> > if (err)
> > return err;
> >
> > - led_trigger_event(host->led, LED_FULL);
> > + if (host->ops->get_cd)
>
> No, this is not the right thing to do. Invoking the ->get_cd() callback,
> for every request is suboptimal and would likely have effects on
> performance.
>
> Moreover, I wonder how big an issue it is to use the led here. If the
> card is being removed, the request will fail anyway, so the led should
> soon stop flashing anyway, right?

Thanks for the feedback.

When I think about it, it seems that an error should be returned from the mmc_card_removed() function when the SD card is removed.
However, in my current board, no error is returned from mmc_card_removed().

I'm guessing it's because of the NULL in the mmc_sd_remove() function in drivers/mmc/core/sd.c , but I'm not sure.
I think it was clumsy because I was a newbie unfamiliar with mmc drivers. :)
I'll take a closer look.

Regards,
Kwon

\
 
 \ /
  Last update: 2021-06-25 07:44    [W:0.062 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site