Message ID | 1534394923-2697-1-git-send-email-dongsheng.wang@hxt-semitech.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] sdhci: acpi: add free_slot callback | expand |
Hello, Adrian, Do you have any comments for this patchset? -Dongsheng On 2018/8/16 12:48, Wang, Dongsheng wrote: > The device specific resource can be free in free_slot after > removing host controller. > > Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com> > --- > drivers/mmc/host/sdhci-acpi.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c > index 32321bd596d8..c61109f7b793 100644 > --- a/drivers/mmc/host/sdhci-acpi.c > +++ b/drivers/mmc/host/sdhci-acpi.c > @@ -76,6 +76,7 @@ struct sdhci_acpi_slot { > size_t priv_size; > int (*probe_slot)(struct platform_device *, const char *, const char *); > int (*remove_slot)(struct platform_device *); > + int (*free_slot)(struct platform_device *pdev); > int (*setup_host)(struct platform_device *pdev); > }; > > @@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) > err_cleanup: > sdhci_cleanup_host(c->host); > err_free: > + if (c->slot && c->slot->free_slot) > + c->slot->free_slot(pdev); > + > sdhci_free_host(c->host); > return err; > } > @@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev) > > dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); > sdhci_remove_host(c->host, dead); > + > + if (c->slot && c->slot->free_slot) > + c->slot->free_slot(pdev); > + > sdhci_free_host(c->host); > > return 0;
On 16/08/18 07:48, Wang Dongsheng wrote: > The device specific resource can be free in free_slot after > removing host controller. > > Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> > --- > drivers/mmc/host/sdhci-acpi.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c > index 32321bd596d8..c61109f7b793 100644 > --- a/drivers/mmc/host/sdhci-acpi.c > +++ b/drivers/mmc/host/sdhci-acpi.c > @@ -76,6 +76,7 @@ struct sdhci_acpi_slot { > size_t priv_size; > int (*probe_slot)(struct platform_device *, const char *, const char *); > int (*remove_slot)(struct platform_device *); > + int (*free_slot)(struct platform_device *pdev); > int (*setup_host)(struct platform_device *pdev); > }; > > @@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) > err_cleanup: > sdhci_cleanup_host(c->host); > err_free: > + if (c->slot && c->slot->free_slot) > + c->slot->free_slot(pdev); > + > sdhci_free_host(c->host); > return err; > } > @@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev) > > dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); > sdhci_remove_host(c->host, dead); > + > + if (c->slot && c->slot->free_slot) > + c->slot->free_slot(pdev); > + > sdhci_free_host(c->host); > > return 0; >
On 16 August 2018 at 06:48, Wang Dongsheng <dongsheng.wang@hxt-semitech.com> wrote: > The device specific resource can be free in free_slot after > removing host controller. > > Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com> Thanks, applied for next! Kind regards Uffe > --- > drivers/mmc/host/sdhci-acpi.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c > index 32321bd596d8..c61109f7b793 100644 > --- a/drivers/mmc/host/sdhci-acpi.c > +++ b/drivers/mmc/host/sdhci-acpi.c > @@ -76,6 +76,7 @@ struct sdhci_acpi_slot { > size_t priv_size; > int (*probe_slot)(struct platform_device *, const char *, const char *); > int (*remove_slot)(struct platform_device *); > + int (*free_slot)(struct platform_device *pdev); > int (*setup_host)(struct platform_device *pdev); > }; > > @@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) > err_cleanup: > sdhci_cleanup_host(c->host); > err_free: > + if (c->slot && c->slot->free_slot) > + c->slot->free_slot(pdev); > + > sdhci_free_host(c->host); > return err; > } > @@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev) > > dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); > sdhci_remove_host(c->host, dead); > + > + if (c->slot && c->slot->free_slot) > + c->slot->free_slot(pdev); > + > sdhci_free_host(c->host); > > return 0; > -- > 2.18.0 >
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 32321bd596d8..c61109f7b793 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -76,6 +76,7 @@ struct sdhci_acpi_slot { size_t priv_size; int (*probe_slot)(struct platform_device *, const char *, const char *); int (*remove_slot)(struct platform_device *); + int (*free_slot)(struct platform_device *pdev); int (*setup_host)(struct platform_device *pdev); }; @@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) err_cleanup: sdhci_cleanup_host(c->host); err_free: + if (c->slot && c->slot->free_slot) + c->slot->free_slot(pdev); + sdhci_free_host(c->host); return err; } @@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev) dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); sdhci_remove_host(c->host, dead); + + if (c->slot && c->slot->free_slot) + c->slot->free_slot(pdev); + sdhci_free_host(c->host); return 0;
The device specific resource can be free in free_slot after removing host controller. Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com> --- drivers/mmc/host/sdhci-acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+)