mmc: sdhci-pci: Build o2micro support in the same module
PATCH 1/2 mmc: sdhci-pci: Build o2micro support in the same module
sdhci-pci-o2micro.c contains no initialisation and its functions are only called from shdci-pci.c, so there is no reason for it to be a separate module, let alone or for it to always be built-in.
- Rename sdhci-pci.c to sdhci-pci-core.c so that the sdhci-pci module can be built from multiple source files
- Add sdhci-pci-o2micro.c to it
- Remove redundant exports
---
drivers/mmc/host/Makefile | 2 +-
drivers/mmc/host/{sdhci-pci.c => sdhci-pci-core.c} | 0
drivers/mmc/host/sdhci-pci-o2micro.c | 4 ----
3 files changed, 1 insertion(+), 5 deletions(-)
rename drivers/mmc/host/{sdhci-pci.c => sdhci-pci-core.c} (100%)drivers/mmc/host/Makefile +1 -1
@@ -9,8 +9,8 @@ obj-$(CONFIG_MMC_MXC) += mxcmmc.o obj-$(CONFIG_MMC_MXS) += mxs-mmc.o obj-$(CONFIG_MMC_SDHCI) += sdhci.o obj-$(CONFIG_MMC_SDHCI_PCI) += sdhci-pci.o +sdhci-pci-y += sdhci-pci-core.o sdhci-pci-o2micro.o obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += sdhci-pci-data.o -obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += sdhci-pci-o2micro.o obj-$(CONFIG_MMC_SDHCI_ACPI) += sdhci-acpi.o obj-$(CONFIG_MMC_SDHCI_PXAV3) += sdhci-pxav3.o obj-$(CONFIG_MMC_SDHCI_PXAV2) += sdhci-pxav2.o
drivers/mmc/host/sdhci-pci-core.c renamed from drivers/mmc/host/sdhci-pci.c +0 -0
drivers/mmc/host/sdhci-pci-o2micro.c +0 -4
@@ -145,7 +145,6 @@ void sdhci_pci_o2_fujin2_pci_init(struct sdhci_pci_chip *chip) scratch_32 |=0x00080000 ;pci_write_config_dword (chip->pdev,O2_SD_MISC_CTRL4 , scratch_32); } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_fujin2_pci_init);int sdhci_pci_o2_probe_slot (struct sdhci_pci_slot *slot) {
@@ -179,7 +178,6 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot)return 0 ; } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_probe_slot);int sdhci_pci_o2_probe (struct sdhci_pci_chip *chip) {
@@ -385,11 +383,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip)return 0 ; } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_probe);int sdhci_pci_o2_resume (struct sdhci_pci_chip *chip) {sdhci_pci_o2_probe (chip);return 0 ; } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_resume);
Signature · 2 lines
Ben Hutchings compatible: Gracefully accepts erroneous data from any source
kbuild test robot
build bot[PATCH] mmc: sdhci-pci: fix simple_return.cocci warnings
drivers/mmc/host/sdhci-pci-core.c:447:1-4: WARNING: end returns can be simpified
drivers/mmc/host/sdhci-pci-core.c:447:1-4: WARNING: end returns can be simpified
Simplify a trivial if-return sequence. Possibly combine with a preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci
---
sdhci-pci-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +1 -5
@@ -444,11 +444,7 @@ static int jmicron_pmos(struct sdhci_pcielse scratch &= ~0x47 ; - ret =pci_write_config_byte (chip->pdev,0xAE , scratch); -if (ret) -return ret; - -return 0 ; +return pci_write_config_byte (chip->pdev,0xAE , scratch); }static int jmicron_probe (struct sdhci_pci_chip *chip)
kbuild test robot
build botcoccinelle warnings: (new ones prefixed by >>)
Hi Ben,
[auto build test WARNING on v4.3-rc4 -- if it's inappropriate base, please ignore]
coccinelle warnings: (new ones prefixed by >>)
>> drivers/mmc/host/sdhci-pci-core.c:447:1-4: WARNING: end returns can be simpified
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Ulf Hansson
AppliedQuoted 10 lines · Ben Hutchings
sdhci-pci-o2micro.ccontains no initialisation and its functions are only called fromshdci-pci.c, so there is no reason for it to be a separate module, let alone or for it to always be built-in.- Rename
sdhci-pci.ctosdhci-pci-core.cso that the sdhci-pci module can be built from multiple source files
- Addsdhci-pci-o2micro.cto it
- Remove redundant exportsSigned-off-by Ben Hutchings <[email protected]>
Thanks, applied patch1, patch2 and the patch fixing the coccinelle warning from build test.
Kind regards
Uffe
Quoted 61 lines
--- drivers/mmc/host/Makefile | 2 +- drivers/mmc/host/{sdhci-pci.c => sdhci-pci-core.c} | 0 drivers/mmc/host/sdhci-pci-o2micro.c | 4 ---- 3 files changed, 1 insertion(+), 5 deletions(-) rename drivers/mmc/host/{sdhci-pci.c => sdhci-pci-core.c} (100%)drivers/mmc/host/Makefile +1
-1@@ -9,8 +9,8 @@ obj-$(CONFIG_MMC_MXC) += mxcmmc.o obj-$(CONFIG_MMC_MXS) += mxs-mmc.o obj-$(CONFIG_MMC_SDHCI) += sdhci.o obj-$(CONFIG_MMC_SDHCI_PCI) += sdhci-pci.o +sdhci-pci-y += sdhci-pci-core.o sdhci-pci-o2micro.o obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += sdhci-pci-data.o -obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += sdhci-pci-o2micro.o obj-$(CONFIG_MMC_SDHCI_ACPI) += sdhci-acpi.o obj-$(CONFIG_MMC_SDHCI_PXAV3) += sdhci-pxav3.o obj-$(CONFIG_MMC_SDHCI_PXAV2) += sdhci-pxav2.odrivers/mmc/host/sdhci-pci-core.c renamed from drivers/mmc/host/sdhci-pci.c +0
-0drivers/mmc/host/sdhci-pci-o2micro.c +0
-5@@ -145,7 +145,6 @@ void sdhci_pci_o2_fujin2_pci_init(struct sdhci_pci_chip *chip) scratch_32 |=0x00080000 ;pci_write_config_dword (chip->pdev,O2_SD_MISC_CTRL4 , scratch_32); } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_fujin2_pci_init);int sdhci_pci_o2_probe_slot (struct sdhci_pci_slot *slot) {@@ -179,7 +178,6 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot)return 0 ; } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_probe_slot);int sdhci_pci_o2_probe (struct sdhci_pci_chip *chip) {@@ -385,11 +383,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip)return 0 ; } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_probe);int sdhci_pci_o2_resume (struct sdhci_pci_chip *chip) {sdhci_pci_o2_probe (chip);return 0 ; } -EXPORT_SYMBOL_GPL (sdhci_pci_o2_resume); --Ben Hutchings
compatible: Gracefully accepts erroneous data from any source