Message ID | 13d8200a-e2a8-d907-38ce-a16fc5ce14aa@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mmc: core: Switch to basic workqueue API for sdio_irq_work | expand |
On Fri, 19 Aug 2022 at 23:26, Heiner Kallweit <hkallweit1@gmail.com> wrote: > > The delay parameter isn't set by any user, therefore simplify the code > and switch to the basic workqueue API w/o delay support. This also > reduces the size of struct mmc_host. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/core/host.c | 2 +- > drivers/mmc/core/sdio.c | 4 ++-- > drivers/mmc/core/sdio_irq.c | 4 ++-- > include/linux/mmc/host.h | 2 +- > 4 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c > index 0fd91f749..b89dca1f1 100644 > --- a/drivers/mmc/core/host.c > +++ b/drivers/mmc/core/host.c > @@ -565,7 +565,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) > spin_lock_init(&host->lock); > init_waitqueue_head(&host->wq); > INIT_DELAYED_WORK(&host->detect, mmc_rescan); > - INIT_DELAYED_WORK(&host->sdio_irq_work, sdio_irq_work); > + INIT_WORK(&host->sdio_irq_work, sdio_irq_work); > timer_setup(&host->retune_timer, mmc_retune_timer, 0); > > /* > diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c > index 0b682a31c..f64b9ac76 100644 > --- a/drivers/mmc/core/sdio.c > +++ b/drivers/mmc/core/sdio.c > @@ -1043,7 +1043,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) > > /* Prevent processing of SDIO IRQs in suspended state. */ > mmc_card_set_suspended(host->card); > - cancel_delayed_work_sync(&host->sdio_irq_work); > + cancel_work_sync(&host->sdio_irq_work); > > mmc_claim_host(host); > > @@ -1103,7 +1103,7 @@ static int mmc_sdio_resume(struct mmc_host *host) > if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) > wake_up_process(host->sdio_irq_thread); > else if (host->caps & MMC_CAP_SDIO_IRQ) > - queue_delayed_work(system_wq, &host->sdio_irq_work, 0); > + schedule_work(&host->sdio_irq_work); > } > > out: > diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c > index 4b1f7c966..2b24bdf38 100644 > --- a/drivers/mmc/core/sdio_irq.c > +++ b/drivers/mmc/core/sdio_irq.c > @@ -124,7 +124,7 @@ static void sdio_run_irqs(struct mmc_host *host) > void sdio_irq_work(struct work_struct *work) > { > struct mmc_host *host = > - container_of(work, struct mmc_host, sdio_irq_work.work); > + container_of(work, struct mmc_host, sdio_irq_work); > > sdio_run_irqs(host); > } > @@ -132,7 +132,7 @@ void sdio_irq_work(struct work_struct *work) > void sdio_signal_irq(struct mmc_host *host) > { > host->sdio_irq_pending = true; > - queue_delayed_work(system_wq, &host->sdio_irq_work, 0); > + schedule_work(&host->sdio_irq_work); > } > EXPORT_SYMBOL_GPL(sdio_signal_irq); > > diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h > index eb8bc5b9b..8fdd3cf97 100644 > --- a/include/linux/mmc/host.h > +++ b/include/linux/mmc/host.h > @@ -476,7 +476,7 @@ struct mmc_host { > > unsigned int sdio_irqs; > struct task_struct *sdio_irq_thread; > - struct delayed_work sdio_irq_work; > + struct work_struct sdio_irq_work; > bool sdio_irq_pending; > atomic_t sdio_irq_thread_abort; > > -- > 2.37.2 >
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 0fd91f749..b89dca1f1 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -565,7 +565,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) spin_lock_init(&host->lock); init_waitqueue_head(&host->wq); INIT_DELAYED_WORK(&host->detect, mmc_rescan); - INIT_DELAYED_WORK(&host->sdio_irq_work, sdio_irq_work); + INIT_WORK(&host->sdio_irq_work, sdio_irq_work); timer_setup(&host->retune_timer, mmc_retune_timer, 0); /* diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 0b682a31c..f64b9ac76 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1043,7 +1043,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) /* Prevent processing of SDIO IRQs in suspended state. */ mmc_card_set_suspended(host->card); - cancel_delayed_work_sync(&host->sdio_irq_work); + cancel_work_sync(&host->sdio_irq_work); mmc_claim_host(host); @@ -1103,7 +1103,7 @@ static int mmc_sdio_resume(struct mmc_host *host) if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) wake_up_process(host->sdio_irq_thread); else if (host->caps & MMC_CAP_SDIO_IRQ) - queue_delayed_work(system_wq, &host->sdio_irq_work, 0); + schedule_work(&host->sdio_irq_work); } out: diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 4b1f7c966..2b24bdf38 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -124,7 +124,7 @@ static void sdio_run_irqs(struct mmc_host *host) void sdio_irq_work(struct work_struct *work) { struct mmc_host *host = - container_of(work, struct mmc_host, sdio_irq_work.work); + container_of(work, struct mmc_host, sdio_irq_work); sdio_run_irqs(host); } @@ -132,7 +132,7 @@ void sdio_irq_work(struct work_struct *work) void sdio_signal_irq(struct mmc_host *host) { host->sdio_irq_pending = true; - queue_delayed_work(system_wq, &host->sdio_irq_work, 0); + schedule_work(&host->sdio_irq_work); } EXPORT_SYMBOL_GPL(sdio_signal_irq); diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index eb8bc5b9b..8fdd3cf97 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -476,7 +476,7 @@ struct mmc_host { unsigned int sdio_irqs; struct task_struct *sdio_irq_thread; - struct delayed_work sdio_irq_work; + struct work_struct sdio_irq_work; bool sdio_irq_pending; atomic_t sdio_irq_thread_abort;
The delay parameter isn't set by any user, therefore simplify the code and switch to the basic workqueue API w/o delay support. This also reduces the size of struct mmc_host. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/mmc/core/host.c | 2 +- drivers/mmc/core/sdio.c | 4 ++-- drivers/mmc/core/sdio_irq.c | 4 ++-- include/linux/mmc/host.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)