linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Use of_device_get_match_data() helper
@ 2022-02-02 18:06 Bean Huo
  2022-02-02 18:06 ` [PATCH 1/5] mmc: wmt-sdmmc: " Bean Huo
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Bean Huo @ 2022-02-02 18:06 UTC (permalink / raw)
  To: ulf.hansson, eugen.hristev, adrian.hunter, nicolas.ferre,
	linux-mmc, linux-kernel
  Cc: beanhuo

From: Bean Huo <beanhuo@micron.com>

*** BLURB HERE ***

Bean Huo (5):
  mmc: wmt-sdmmc: Use of_device_get_match_data() helper
  mmc: sdhci-tegra: Use of_device_get_match_data() helper
  mmc: sdhci-omap: Use of_device_get_match_data() helper
  mmc: sdhci-of-at91: Use of_device_get_match_data() helper
  mmc: davinci: Use of_device_get_match_data() helper

 drivers/mmc/host/davinci_mmc.c   | 6 ++----
 drivers/mmc/host/sdhci-of-at91.c | 6 ++----
 drivers/mmc/host/sdhci-omap.c    | 7 +------
 drivers/mmc/host/sdhci-tegra.c   | 6 ++----
 drivers/mmc/host/wmt-sdmmc.c     | 7 ++-----
 5 files changed, 9 insertions(+), 23 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/5] mmc: wmt-sdmmc: Use of_device_get_match_data() helper
  2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
@ 2022-02-02 18:06 ` Bean Huo
  2022-02-02 18:06 ` [PATCH 2/5] mmc: sdhci-tegra: " Bean Huo
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Bean Huo @ 2022-02-02 18:06 UTC (permalink / raw)
  To: ulf.hansson, eugen.hristev, adrian.hunter, nicolas.ferre,
	linux-mmc, linux-kernel
  Cc: beanhuo

From: Bean Huo <beanhuo@micron.com>

Only the device data is needed, not the whole struct of_device_id.
Use of_device_get_match_data() instead of open coding of of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/mmc/host/wmt-sdmmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
index cf10949fb0ac..163ac9df8cca 100644
--- a/drivers/mmc/host/wmt-sdmmc.c
+++ b/drivers/mmc/host/wmt-sdmmc.c
@@ -751,19 +751,16 @@ static int wmt_mci_probe(struct platform_device *pdev)
 	struct mmc_host *mmc;
 	struct wmt_mci_priv *priv;
 	struct device_node *np = pdev->dev.of_node;
-	const struct of_device_id *of_id =
-		of_match_device(wmt_mci_dt_ids, &pdev->dev);
 	const struct wmt_mci_caps *wmt_caps;
 	int ret;
 	int regular_irq, dma_irq;
 
-	if (!of_id || !of_id->data) {
+	wmt_caps = of_device_get_match_data(&pdev->dev);
+	if (!wmt_caps) {
 		dev_err(&pdev->dev, "Controller capabilities data missing\n");
 		return -EFAULT;
 	}
 
-	wmt_caps = of_id->data;
-
 	if (!np) {
 		dev_err(&pdev->dev, "Missing SDMMC description in devicetree\n");
 		return -EFAULT;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/5] mmc: sdhci-tegra: Use of_device_get_match_data() helper
  2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
  2022-02-02 18:06 ` [PATCH 1/5] mmc: wmt-sdmmc: " Bean Huo
@ 2022-02-02 18:06 ` Bean Huo
  2022-02-02 18:06 ` [PATCH 3/5] mmc: sdhci-omap: " Bean Huo
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Bean Huo @ 2022-02-02 18:06 UTC (permalink / raw)
  To: ulf.hansson, eugen.hristev, adrian.hunter, nicolas.ferre,
	linux-mmc, linux-kernel
  Cc: beanhuo

From: Bean Huo <beanhuo@micron.com>

Only the device data is needed,not the whole struct of_device_id.
Use of_device_get_match_data() instead of open coding of of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/mmc/host/sdhci-tegra.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 35ebba067e87..0c9f778ea860 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -1618,7 +1618,6 @@ static int sdhci_tegra_add_host(struct sdhci_host *host)
 
 static int sdhci_tegra_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *match;
 	const struct sdhci_tegra_soc_data *soc_data;
 	struct sdhci_host *host;
 	struct sdhci_pltfm_host *pltfm_host;
@@ -1626,10 +1625,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
 	struct clk *clk;
 	int rc;
 
-	match = of_match_device(sdhci_tegra_dt_match, &pdev->dev);
-	if (!match)
+	soc_data = of_device_get_match_data(&pdev->dev);
+	if (!soc_data)
 		return -EINVAL;
-	soc_data = match->data;
 
 	host = sdhci_pltfm_init(pdev, soc_data->pdata, sizeof(*tegra_host));
 	if (IS_ERR(host))
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/5] mmc: sdhci-omap: Use of_device_get_match_data() helper
  2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
  2022-02-02 18:06 ` [PATCH 1/5] mmc: wmt-sdmmc: " Bean Huo
  2022-02-02 18:06 ` [PATCH 2/5] mmc: sdhci-tegra: " Bean Huo
@ 2022-02-02 18:06 ` Bean Huo
  2022-02-03  2:39   ` kernel test robot
  2022-02-03  4:21   ` kernel test robot
  2022-02-02 18:06 ` [PATCH 4/5] mmc: sdhci-of-at91: " Bean Huo
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 10+ messages in thread
From: Bean Huo @ 2022-02-02 18:06 UTC (permalink / raw)
  To: ulf.hansson, eugen.hristev, adrian.hunter, nicolas.ferre,
	linux-mmc, linux-kernel
  Cc: beanhuo

From: Bean Huo <beanhuo@micron.com>

Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of open coding of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/mmc/host/sdhci-omap.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index 64e27c2821f9..676e3cbbfc95 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1219,16 +1219,11 @@ static int sdhci_omap_probe(struct platform_device *pdev)
 	struct sdhci_pltfm_host *pltfm_host;
 	struct sdhci_omap_host *omap_host;
 	struct mmc_host *mmc;
-	const struct of_device_id *match;
 	struct sdhci_omap_data *data;
 	const struct soc_device_attribute *soc;
 	struct resource *regs;
 
-	match = of_match_device(omap_sdhci_match, dev);
-	if (!match)
-		return -EINVAL;
-
-	data = (struct sdhci_omap_data *)match->data;
+	data = of_device_get_match_data(&pdev->dev);
 	if (!data) {
 		dev_err(dev, "no sdhci omap data\n");
 		return -EINVAL;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/5] mmc: sdhci-of-at91: Use of_device_get_match_data() helper
  2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
                   ` (2 preceding siblings ...)
  2022-02-02 18:06 ` [PATCH 3/5] mmc: sdhci-omap: " Bean Huo
@ 2022-02-02 18:06 ` Bean Huo
  2022-02-02 18:06 ` [PATCH 5/5] mmc: davinci: " Bean Huo
  2022-02-08 15:12 ` [PATCH 0/5] " Ulf Hansson
  5 siblings, 0 replies; 10+ messages in thread
From: Bean Huo @ 2022-02-02 18:06 UTC (permalink / raw)
  To: ulf.hansson, eugen.hristev, adrian.hunter, nicolas.ferre,
	linux-mmc, linux-kernel
  Cc: beanhuo

From: Bean Huo <beanhuo@micron.com>

Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of open coding of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/mmc/host/sdhci-of-at91.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
index d1a1c548c515..10fb4cb2c731 100644
--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -308,17 +308,15 @@ static const struct dev_pm_ops sdhci_at91_dev_pm_ops = {
 
 static int sdhci_at91_probe(struct platform_device *pdev)
 {
-	const struct of_device_id	*match;
 	const struct sdhci_at91_soc_data	*soc_data;
 	struct sdhci_host		*host;
 	struct sdhci_pltfm_host		*pltfm_host;
 	struct sdhci_at91_priv		*priv;
 	int				ret;
 
-	match = of_match_device(sdhci_at91_dt_match, &pdev->dev);
-	if (!match)
+	soc_data = of_device_get_match_data(&pdev->dev);
+	if (!soc_data)
 		return -EINVAL;
-	soc_data = match->data;
 
 	host = sdhci_pltfm_init(pdev, soc_data->pdata, sizeof(*priv));
 	if (IS_ERR(host))
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/5] mmc: davinci: Use of_device_get_match_data() helper
  2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
                   ` (3 preceding siblings ...)
  2022-02-02 18:06 ` [PATCH 4/5] mmc: sdhci-of-at91: " Bean Huo
@ 2022-02-02 18:06 ` Bean Huo
  2022-02-08 15:12 ` [PATCH 0/5] " Ulf Hansson
  5 siblings, 0 replies; 10+ messages in thread
From: Bean Huo @ 2022-02-02 18:06 UTC (permalink / raw)
  To: ulf.hansson, eugen.hristev, adrian.hunter, nicolas.ferre,
	linux-mmc, linux-kernel
  Cc: beanhuo

From: Bean Huo <beanhuo@micron.com>

Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/mmc/host/davinci_mmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 2a757c88f9d2..0cf646ec9a80 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1189,7 +1189,6 @@ static int mmc_davinci_parse_pdata(struct mmc_host *mmc)
 
 static int davinci_mmcsd_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *match;
 	struct mmc_davinci_host *host = NULL;
 	struct mmc_host *mmc = NULL;
 	struct resource *r, *mem = NULL;
@@ -1235,9 +1234,8 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
 
 	host->mmc_input_clk = clk_get_rate(host->clk);
 
-	match = of_match_device(davinci_mmc_dt_ids, &pdev->dev);
-	if (match) {
-		pdev->id_entry = match->data;
+	pdev->id_entry = of_device_get_match_data(&pdev->dev);
+	if (pdev->id_entry) {
 		ret = mmc_of_parse(mmc);
 		if (ret) {
 			dev_err_probe(&pdev->dev, ret,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/5] mmc: sdhci-omap: Use of_device_get_match_data() helper
  2022-02-02 18:06 ` [PATCH 3/5] mmc: sdhci-omap: " Bean Huo
@ 2022-02-03  2:39   ` kernel test robot
  2022-02-03  4:21   ` kernel test robot
  1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-02-03  2:39 UTC (permalink / raw)
  To: Bean Huo, ulf.hansson, eugen.hristev, adrian.hunter,
	nicolas.ferre, linux-mmc, linux-kernel
  Cc: kbuild-all, beanhuo

Hi Bean,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on linus/master ulf-hansson-mmc-mirror/next v5.17-rc2 next-20220202]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Bean-Huo/Use-of_device_get_match_data-helper/20220203-020721
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20220203/202202030919.aWKiSg0Q-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/33ccc62e7dd0ac8f965521ed7ff44ff52182f4b0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Bean-Huo/Use-of_device_get_match_data-helper/20220203-020721
        git checkout 33ccc62e7dd0ac8f965521ed7ff44ff52182f4b0
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash drivers/iio/multiplexer/ drivers/mmc/host/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/mmc/host/sdhci-omap.c: In function 'sdhci_omap_probe':
>> drivers/mmc/host/sdhci-omap.c:1226:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1226 |         data = of_device_get_match_data(&pdev->dev);
         |              ^


vim +/const +1226 drivers/mmc/host/sdhci-omap.c

  1212	
  1213	static int sdhci_omap_probe(struct platform_device *pdev)
  1214	{
  1215		int ret;
  1216		u32 offset;
  1217		struct device *dev = &pdev->dev;
  1218		struct sdhci_host *host;
  1219		struct sdhci_pltfm_host *pltfm_host;
  1220		struct sdhci_omap_host *omap_host;
  1221		struct mmc_host *mmc;
  1222		struct sdhci_omap_data *data;
  1223		const struct soc_device_attribute *soc;
  1224		struct resource *regs;
  1225	
> 1226		data = of_device_get_match_data(&pdev->dev);
  1227		if (!data) {
  1228			dev_err(dev, "no sdhci omap data\n");
  1229			return -EINVAL;
  1230		}
  1231		offset = data->offset;
  1232	
  1233		regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  1234		if (!regs)
  1235			return -ENXIO;
  1236	
  1237		host = sdhci_pltfm_init(pdev, &sdhci_omap_pdata,
  1238					sizeof(*omap_host));
  1239		if (IS_ERR(host)) {
  1240			dev_err(dev, "Failed sdhci_pltfm_init\n");
  1241			return PTR_ERR(host);
  1242		}
  1243	
  1244		pltfm_host = sdhci_priv(host);
  1245		omap_host = sdhci_pltfm_priv(pltfm_host);
  1246		omap_host->host = host;
  1247		omap_host->base = host->ioaddr;
  1248		omap_host->dev = dev;
  1249		omap_host->power_mode = MMC_POWER_UNDEFINED;
  1250		omap_host->timing = MMC_TIMING_LEGACY;
  1251		omap_host->flags = data->flags;
  1252		omap_host->omap_offset = data->omap_offset;
  1253		omap_host->con = -EINVAL; /* Prevent invalid restore on first resume */
  1254		host->ioaddr += offset;
  1255		host->mapbase = regs->start + offset;
  1256	
  1257		mmc = host->mmc;
  1258		sdhci_get_of_property(pdev);
  1259		ret = mmc_of_parse(mmc);
  1260		if (ret)
  1261			goto err_pltfm_free;
  1262	
  1263		soc = soc_device_match(sdhci_omap_soc_devices);
  1264		if (soc) {
  1265			omap_host->version = "rev11";
  1266			if (!strcmp(dev_name(dev), "4809c000.mmc"))
  1267				mmc->f_max = 96000000;
  1268			if (!strcmp(dev_name(dev), "480b4000.mmc"))
  1269				mmc->f_max = 48000000;
  1270			if (!strcmp(dev_name(dev), "480ad000.mmc"))
  1271				mmc->f_max = 48000000;
  1272		}
  1273	
  1274		if (!mmc_can_gpio_ro(mmc))
  1275			mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
  1276	
  1277		pltfm_host->clk = devm_clk_get(dev, "fck");
  1278		if (IS_ERR(pltfm_host->clk)) {
  1279			ret = PTR_ERR(pltfm_host->clk);
  1280			goto err_pltfm_free;
  1281		}
  1282	
  1283		ret = clk_set_rate(pltfm_host->clk, mmc->f_max);
  1284		if (ret) {
  1285			dev_err(dev, "failed to set clock to %d\n", mmc->f_max);
  1286			goto err_pltfm_free;
  1287		}
  1288	
  1289		omap_host->pbias = devm_regulator_get_optional(dev, "pbias");
  1290		if (IS_ERR(omap_host->pbias)) {
  1291			ret = PTR_ERR(omap_host->pbias);
  1292			if (ret != -ENODEV)
  1293				goto err_pltfm_free;
  1294			dev_dbg(dev, "unable to get pbias regulator %d\n", ret);
  1295		}
  1296		omap_host->pbias_enabled = false;
  1297	
  1298		/*
  1299		 * omap_device_pm_domain has callbacks to enable the main
  1300		 * functional clock, interface clock and also configure the
  1301		 * SYSCONFIG register of omap devices. The callback will be invoked
  1302		 * as part of pm_runtime_get_sync.
  1303		 */
  1304		pm_runtime_use_autosuspend(dev);
  1305		pm_runtime_set_autosuspend_delay(dev, 50);
  1306		pm_runtime_enable(dev);
  1307		ret = pm_runtime_resume_and_get(dev);
  1308		if (ret) {
  1309			dev_err(dev, "pm_runtime_get_sync failed\n");
  1310			goto err_rpm_disable;
  1311		}
  1312	
  1313		ret = sdhci_omap_set_capabilities(host);
  1314		if (ret) {
  1315			dev_err(dev, "failed to set system capabilities\n");
  1316			goto err_rpm_put;
  1317		}
  1318	
  1319		host->mmc_host_ops.start_signal_voltage_switch =
  1320						sdhci_omap_start_signal_voltage_switch;
  1321		host->mmc_host_ops.set_ios = sdhci_omap_set_ios;
  1322		host->mmc_host_ops.card_busy = sdhci_omap_card_busy;
  1323		host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning;
  1324		host->mmc_host_ops.enable_sdio_irq = sdhci_omap_enable_sdio_irq;
  1325	
  1326		/*
  1327		 * Switch to external DMA only if there is the "dmas" property and
  1328		 * ADMA is not available on the controller instance.
  1329		 */
  1330		if (device_property_present(dev, "dmas") &&
  1331		    !sdhci_omap_has_adma(omap_host, offset))
  1332			sdhci_switch_external_dma(host, true);
  1333	
  1334		if (device_property_read_bool(dev, "ti,non-removable")) {
  1335			dev_warn_once(dev, "using old ti,non-removable property\n");
  1336			mmc->caps |= MMC_CAP_NONREMOVABLE;
  1337		}
  1338	
  1339		/* R1B responses is required to properly manage HW busy detection. */
  1340		mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
  1341	
  1342		/* Allow card power off and runtime PM for eMMC/SD card devices */
  1343		mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_AGGRESSIVE_PM;
  1344	
  1345		ret = sdhci_setup_host(host);
  1346		if (ret)
  1347			goto err_rpm_put;
  1348	
  1349		ret = sdhci_omap_config_iodelay_pinctrl_state(omap_host);
  1350		if (ret)
  1351			goto err_cleanup_host;
  1352	
  1353		ret = __sdhci_add_host(host);
  1354		if (ret)
  1355			goto err_cleanup_host;
  1356	
  1357		/*
  1358		 * SDIO devices can use the dat1 pin as a wake-up interrupt. Some
  1359		 * devices like wl1xxx, use an out-of-band GPIO interrupt instead.
  1360		 */
  1361		omap_host->wakeirq = of_irq_get_byname(dev->of_node, "wakeup");
  1362		if (omap_host->wakeirq == -EPROBE_DEFER) {
  1363			ret = -EPROBE_DEFER;
  1364			goto err_cleanup_host;
  1365		}
  1366		if (omap_host->wakeirq > 0) {
  1367			device_init_wakeup(dev, true);
  1368			ret = dev_pm_set_dedicated_wake_irq(dev, omap_host->wakeirq);
  1369			if (ret) {
  1370				device_init_wakeup(dev, false);
  1371				goto err_cleanup_host;
  1372			}
  1373			host->mmc->pm_caps |= MMC_PM_KEEP_POWER | MMC_PM_WAKE_SDIO_IRQ;
  1374		}
  1375	
  1376		pm_runtime_mark_last_busy(dev);
  1377		pm_runtime_put_autosuspend(dev);
  1378	
  1379		return 0;
  1380	
  1381	err_cleanup_host:
  1382		sdhci_cleanup_host(host);
  1383	
  1384	err_rpm_put:
  1385		pm_runtime_mark_last_busy(dev);
  1386		pm_runtime_put_autosuspend(dev);
  1387	err_rpm_disable:
  1388		pm_runtime_dont_use_autosuspend(dev);
  1389		pm_runtime_disable(dev);
  1390	
  1391	err_pltfm_free:
  1392		sdhci_pltfm_free(pdev);
  1393		return ret;
  1394	}
  1395	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/5] mmc: sdhci-omap: Use of_device_get_match_data() helper
  2022-02-02 18:06 ` [PATCH 3/5] mmc: sdhci-omap: " Bean Huo
  2022-02-03  2:39   ` kernel test robot
@ 2022-02-03  4:21   ` kernel test robot
  1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-02-03  4:21 UTC (permalink / raw)
  To: Bean Huo, ulf.hansson, eugen.hristev, adrian.hunter,
	nicolas.ferre, linux-mmc, linux-kernel
  Cc: kbuild-all, beanhuo

Hi Bean,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on linus/master ulf-hansson-mmc-mirror/next v5.17-rc2 next-20220202]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Bean-Huo/Use-of_device_get_match_data-helper/20220203-020721
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: openrisc-randconfig-s031-20220131 (https://download.01.org/0day-ci/archive/20220203/202202031221.asY8tGvu-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/33ccc62e7dd0ac8f965521ed7ff44ff52182f4b0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Bean-Huo/Use-of_device_get_match_data-helper/20220203-020721
        git checkout 33ccc62e7dd0ac8f965521ed7ff44ff52182f4b0
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/mmc/host/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/mmc/host/sdhci-omap.c:1226:14: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct sdhci_omap_data *data @@     got void const * @@
   drivers/mmc/host/sdhci-omap.c:1226:14: sparse:     expected struct sdhci_omap_data *data
   drivers/mmc/host/sdhci-omap.c:1226:14: sparse:     got void const *

vim +1226 drivers/mmc/host/sdhci-omap.c

  1212	
  1213	static int sdhci_omap_probe(struct platform_device *pdev)
  1214	{
  1215		int ret;
  1216		u32 offset;
  1217		struct device *dev = &pdev->dev;
  1218		struct sdhci_host *host;
  1219		struct sdhci_pltfm_host *pltfm_host;
  1220		struct sdhci_omap_host *omap_host;
  1221		struct mmc_host *mmc;
  1222		struct sdhci_omap_data *data;
  1223		const struct soc_device_attribute *soc;
  1224		struct resource *regs;
  1225	
> 1226		data = of_device_get_match_data(&pdev->dev);
  1227		if (!data) {
  1228			dev_err(dev, "no sdhci omap data\n");
  1229			return -EINVAL;
  1230		}
  1231		offset = data->offset;
  1232	
  1233		regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  1234		if (!regs)
  1235			return -ENXIO;
  1236	
  1237		host = sdhci_pltfm_init(pdev, &sdhci_omap_pdata,
  1238					sizeof(*omap_host));
  1239		if (IS_ERR(host)) {
  1240			dev_err(dev, "Failed sdhci_pltfm_init\n");
  1241			return PTR_ERR(host);
  1242		}
  1243	
  1244		pltfm_host = sdhci_priv(host);
  1245		omap_host = sdhci_pltfm_priv(pltfm_host);
  1246		omap_host->host = host;
  1247		omap_host->base = host->ioaddr;
  1248		omap_host->dev = dev;
  1249		omap_host->power_mode = MMC_POWER_UNDEFINED;
  1250		omap_host->timing = MMC_TIMING_LEGACY;
  1251		omap_host->flags = data->flags;
  1252		omap_host->omap_offset = data->omap_offset;
  1253		omap_host->con = -EINVAL; /* Prevent invalid restore on first resume */
  1254		host->ioaddr += offset;
  1255		host->mapbase = regs->start + offset;
  1256	
  1257		mmc = host->mmc;
  1258		sdhci_get_of_property(pdev);
  1259		ret = mmc_of_parse(mmc);
  1260		if (ret)
  1261			goto err_pltfm_free;
  1262	
  1263		soc = soc_device_match(sdhci_omap_soc_devices);
  1264		if (soc) {
  1265			omap_host->version = "rev11";
  1266			if (!strcmp(dev_name(dev), "4809c000.mmc"))
  1267				mmc->f_max = 96000000;
  1268			if (!strcmp(dev_name(dev), "480b4000.mmc"))
  1269				mmc->f_max = 48000000;
  1270			if (!strcmp(dev_name(dev), "480ad000.mmc"))
  1271				mmc->f_max = 48000000;
  1272		}
  1273	
  1274		if (!mmc_can_gpio_ro(mmc))
  1275			mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
  1276	
  1277		pltfm_host->clk = devm_clk_get(dev, "fck");
  1278		if (IS_ERR(pltfm_host->clk)) {
  1279			ret = PTR_ERR(pltfm_host->clk);
  1280			goto err_pltfm_free;
  1281		}
  1282	
  1283		ret = clk_set_rate(pltfm_host->clk, mmc->f_max);
  1284		if (ret) {
  1285			dev_err(dev, "failed to set clock to %d\n", mmc->f_max);
  1286			goto err_pltfm_free;
  1287		}
  1288	
  1289		omap_host->pbias = devm_regulator_get_optional(dev, "pbias");
  1290		if (IS_ERR(omap_host->pbias)) {
  1291			ret = PTR_ERR(omap_host->pbias);
  1292			if (ret != -ENODEV)
  1293				goto err_pltfm_free;
  1294			dev_dbg(dev, "unable to get pbias regulator %d\n", ret);
  1295		}
  1296		omap_host->pbias_enabled = false;
  1297	
  1298		/*
  1299		 * omap_device_pm_domain has callbacks to enable the main
  1300		 * functional clock, interface clock and also configure the
  1301		 * SYSCONFIG register of omap devices. The callback will be invoked
  1302		 * as part of pm_runtime_get_sync.
  1303		 */
  1304		pm_runtime_use_autosuspend(dev);
  1305		pm_runtime_set_autosuspend_delay(dev, 50);
  1306		pm_runtime_enable(dev);
  1307		ret = pm_runtime_resume_and_get(dev);
  1308		if (ret) {
  1309			dev_err(dev, "pm_runtime_get_sync failed\n");
  1310			goto err_rpm_disable;
  1311		}
  1312	
  1313		ret = sdhci_omap_set_capabilities(host);
  1314		if (ret) {
  1315			dev_err(dev, "failed to set system capabilities\n");
  1316			goto err_rpm_put;
  1317		}
  1318	
  1319		host->mmc_host_ops.start_signal_voltage_switch =
  1320						sdhci_omap_start_signal_voltage_switch;
  1321		host->mmc_host_ops.set_ios = sdhci_omap_set_ios;
  1322		host->mmc_host_ops.card_busy = sdhci_omap_card_busy;
  1323		host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning;
  1324		host->mmc_host_ops.enable_sdio_irq = sdhci_omap_enable_sdio_irq;
  1325	
  1326		/*
  1327		 * Switch to external DMA only if there is the "dmas" property and
  1328		 * ADMA is not available on the controller instance.
  1329		 */
  1330		if (device_property_present(dev, "dmas") &&
  1331		    !sdhci_omap_has_adma(omap_host, offset))
  1332			sdhci_switch_external_dma(host, true);
  1333	
  1334		if (device_property_read_bool(dev, "ti,non-removable")) {
  1335			dev_warn_once(dev, "using old ti,non-removable property\n");
  1336			mmc->caps |= MMC_CAP_NONREMOVABLE;
  1337		}
  1338	
  1339		/* R1B responses is required to properly manage HW busy detection. */
  1340		mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
  1341	
  1342		/* Allow card power off and runtime PM for eMMC/SD card devices */
  1343		mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_AGGRESSIVE_PM;
  1344	
  1345		ret = sdhci_setup_host(host);
  1346		if (ret)
  1347			goto err_rpm_put;
  1348	
  1349		ret = sdhci_omap_config_iodelay_pinctrl_state(omap_host);
  1350		if (ret)
  1351			goto err_cleanup_host;
  1352	
  1353		ret = __sdhci_add_host(host);
  1354		if (ret)
  1355			goto err_cleanup_host;
  1356	
  1357		/*
  1358		 * SDIO devices can use the dat1 pin as a wake-up interrupt. Some
  1359		 * devices like wl1xxx, use an out-of-band GPIO interrupt instead.
  1360		 */
  1361		omap_host->wakeirq = of_irq_get_byname(dev->of_node, "wakeup");
  1362		if (omap_host->wakeirq == -EPROBE_DEFER) {
  1363			ret = -EPROBE_DEFER;
  1364			goto err_cleanup_host;
  1365		}
  1366		if (omap_host->wakeirq > 0) {
  1367			device_init_wakeup(dev, true);
  1368			ret = dev_pm_set_dedicated_wake_irq(dev, omap_host->wakeirq);
  1369			if (ret) {
  1370				device_init_wakeup(dev, false);
  1371				goto err_cleanup_host;
  1372			}
  1373			host->mmc->pm_caps |= MMC_PM_KEEP_POWER | MMC_PM_WAKE_SDIO_IRQ;
  1374		}
  1375	
  1376		pm_runtime_mark_last_busy(dev);
  1377		pm_runtime_put_autosuspend(dev);
  1378	
  1379		return 0;
  1380	
  1381	err_cleanup_host:
  1382		sdhci_cleanup_host(host);
  1383	
  1384	err_rpm_put:
  1385		pm_runtime_mark_last_busy(dev);
  1386		pm_runtime_put_autosuspend(dev);
  1387	err_rpm_disable:
  1388		pm_runtime_dont_use_autosuspend(dev);
  1389		pm_runtime_disable(dev);
  1390	
  1391	err_pltfm_free:
  1392		sdhci_pltfm_free(pdev);
  1393		return ret;
  1394	}
  1395	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] Use of_device_get_match_data() helper
  2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
                   ` (4 preceding siblings ...)
  2022-02-02 18:06 ` [PATCH 5/5] mmc: davinci: " Bean Huo
@ 2022-02-08 15:12 ` Ulf Hansson
  2022-02-08 16:44   ` Bean Huo
  5 siblings, 1 reply; 10+ messages in thread
From: Ulf Hansson @ 2022-02-08 15:12 UTC (permalink / raw)
  To: Bean Huo
  Cc: Eugen.Hristev, adrian.hunter, nicolas.ferre, linux-mmc,
	linux-kernel, beanhuo

On Wed, 2 Feb 2022 at 19:07, Bean Huo <huobean@gmail.com> wrote:
>
> From: Bean Huo <beanhuo@micron.com>
>
> *** BLURB HERE ***
>
> Bean Huo (5):
>   mmc: wmt-sdmmc: Use of_device_get_match_data() helper
>   mmc: sdhci-tegra: Use of_device_get_match_data() helper
>   mmc: sdhci-omap: Use of_device_get_match_data() helper
>   mmc: sdhci-of-at91: Use of_device_get_match_data() helper
>   mmc: davinci: Use of_device_get_match_data() helper
>
>  drivers/mmc/host/davinci_mmc.c   | 6 ++----
>  drivers/mmc/host/sdhci-of-at91.c | 6 ++----
>  drivers/mmc/host/sdhci-omap.c    | 7 +------
>  drivers/mmc/host/sdhci-tegra.c   | 6 ++----
>  drivers/mmc/host/wmt-sdmmc.c     | 7 ++-----
>  5 files changed, 9 insertions(+), 23 deletions(-)
>

Series applied for next, except patch3 that seems to need some minor
adjustments, thanks!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] Use of_device_get_match_data() helper
  2022-02-08 15:12 ` [PATCH 0/5] " Ulf Hansson
@ 2022-02-08 16:44   ` Bean Huo
  0 siblings, 0 replies; 10+ messages in thread
From: Bean Huo @ 2022-02-08 16:44 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Eugen.Hristev, adrian.hunter, nicolas.ferre, linux-mmc,
	linux-kernel, beanhuo

On Tue, 2022-02-08 at 16:12 +0100, Ulf Hansson wrote:
> On Wed, 2 Feb 2022 at 19:07, Bean Huo <huobean@gmail.com> wrote:
> > From: Bean Huo <beanhuo@micron.com>
> > 
> > *** BLURB HERE ***
> > 
> > Bean Huo (5):
> >   mmc: wmt-sdmmc: Use of_device_get_match_data() helper
> >   mmc: sdhci-tegra: Use of_device_get_match_data() helper
> >   mmc: sdhci-omap: Use of_device_get_match_data() helper
> >   mmc: sdhci-of-at91: Use of_device_get_match_data() helper
> >   mmc: davinci: Use of_device_get_match_data() helper
> > 
> >  drivers/mmc/host/davinci_mmc.c   | 6 ++----
> >  drivers/mmc/host/sdhci-of-at91.c | 6 ++----
> >  drivers/mmc/host/sdhci-omap.c    | 7 +------
> >  drivers/mmc/host/sdhci-tegra.c   | 6 ++----
> >  drivers/mmc/host/wmt-sdmmc.c     | 7 ++-----
> >  5 files changed, 9 insertions(+), 23 deletions(-)
> > 
> 
> Series applied for next, except patch3 that seems to need some minor
> adjustments, thanks!
> 

Thanks, I will update the patch3.

Kind regards,
Bean

> Kind regards
> Uffe


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-08 17:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
2022-02-02 18:06 ` [PATCH 1/5] mmc: wmt-sdmmc: " Bean Huo
2022-02-02 18:06 ` [PATCH 2/5] mmc: sdhci-tegra: " Bean Huo
2022-02-02 18:06 ` [PATCH 3/5] mmc: sdhci-omap: " Bean Huo
2022-02-03  2:39   ` kernel test robot
2022-02-03  4:21   ` kernel test robot
2022-02-02 18:06 ` [PATCH 4/5] mmc: sdhci-of-at91: " Bean Huo
2022-02-02 18:06 ` [PATCH 5/5] mmc: davinci: " Bean Huo
2022-02-08 15:12 ` [PATCH 0/5] " Ulf Hansson
2022-02-08 16:44   ` Bean Huo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).