Fix mtd parent device not showing up in sysfs
Subsystems (12)
v2 cover Fix mtd parent device not showing up in sysfs
Here's the second iteration of a series stemming from a previous discussion about mtd devices not showing up in sysfs properly[1]. While the original series 27 patches, this one should cover all drivers that suffer from this issue, and shamelessly hits 60. Again, if it's preferred that the patches are grouped differently, like by mtd subdir, I'd be happy to resend. Until then, we'll make do with this.
This series teaches add_mtd_device() to set name and owner based on the set parent device, if dev.parent is filled in, and name resp. owner isn't already filled in. All drivers that I could find that don't set the parent are touched to set the parent device, and remove the name and owner assignment in cases where I'm sure the resulting name will not change. Only the latter is done in cases where I would find the driver explicitly filling in the owner.
Thanks for having a go at your favorite MTD,
Frans
v1..v2
- Overall: make it more clear that it's about a parent device symlink gone missing (thanks, Brian)
- Fix compile error in 30: "fsmc_nand: show parent device in sysfs"
- Fix possible null-pointer dereference in 02: "mtd: core: set some
defaults..."
[1] https://lkml.org/lkml/2014/5/26/586
Frans Klaver (60):
mtd: core: tone down suggestion that dev.parent should be set
mtd: core: set some defaults when dev.parent is set
mtd: devices: bcm47xxflash: show parent device in sysfs
mtd: devices: docg3: show parent device in sysfs
mtd: devices: m25p80: show parent device in sysfs
mtd: devices: mtd_dataflash: drop owner assignment
mtd: devices: spear_smi: show parent device in sysfs
mtd: devices: sst251: show parent device in sysfs
mtd: lpddr: show parent device in sysfs
mtd: maps: bfin-async-flash: show parent device in sysfs
mtd: maps: gpio-addr-flash: show parent device in sysfs
mtd: maps: intel_vr_nor: show parent device in sysfs
mtd: maps: ixp4xx: show parent device in sysfs
mtd: maps: lantiq-flash: show parent device in sysfs
mtd: maps: latch-addr-flash: show parent device in sysfs
mtd: maps: physmap: drop owner assignment
mtd: maps: physmap_of: drop owner assignment
mtd: maps: plat_ram: drop owner assignment
mtd: maps: pxa2xx-flash: show parent device in sysfs
mtd: maps: rbtx4939-flash: show parent device in sysfs
mtd: maps: sa1100-flash: show parent device in sysfs
mtd: nand: atmel_nand: show parent device in sysfs
mtd: nand: au1550nd: show parent device in sysfs
mtd: nand: bcm47xxnflash: show parent device in sysfs
mtd: nand: bf5xx_nand: show parent device in sysfs
mtd: nand: cafe_nand: drop owner assignment
mtd: nand: davinci_nand: drop owner and name assignment
mtd: nand: denali: drop owner assignment
mtd: nand: docg4: show parent device in sysfs
mtd: nand: fsl_elbc_nand: show parent device in sysfs
mtd: nand: fsl_ifc_nand: show parent device in sysfs
mtd: nand: fsl_upm: show parent device in sysfs
mtd: nand: fsmc_nand: show parent device in sysfs
mtd: nand: gpio: show parent device in sysfs
mtd: nand: gpmi-nand: show parent device in sysfs
mtd: nand: hisi504_nand: drop owner assignment
mtd: nand: jz4740_nand: show parent device in sysfs
mtd: nand: lpc32xx_mlc: drop owner assignment
mtd: nand: mpc5121_nfc: show parent device in sysfs
mtd: nand: mxc_nand: drop owner assignment
mtd: nand: ndfc: show parent device in sysfs
mtd: nand: nuc900_nand: show parent device in sysfs
mtd: nand: omap2: show parent device structure in sysfs
mtd: nand: orion_nand: show parent device in sysfs
mtd: nand: pasemi_nand: show parent device in sysfs
mtd: nand: plat_nand: show parent device in sysfs
mtd: nand: pxa3xx_nand: show parent device in sysfs
mtd: nand: r852: drop owner assignment
mtd: nand: s3c2410: show parent device in sysfs
mtd: nand: sh_flctl: show parent device in sysfs
mtd: nand: sharpsl: show parent device in sysfs
mtd: nand: socrates_nand: drop owner assignment
mtd: nand: sunxi_nand: drop owner assignment
mtd: nand: tmio_nand: show parent device in sysfs
mtd: nand: txx9ndfmc: show parent device in sysfs
mtd: onenand: generic: show parent device in sysfs
mtd: onenand: omap2: drop owner and name assignment
mtd: onenand: samsung: drop owner assignment
mtd: spi-nor: fsl-quadspi: show parent device in sysfs
staging: mt29f_spinand: show parent device in sysfs
drivers/mtd/devices/bcm47xxsflash.c | 7 ++++--- drivers/mtd/devices/docg3.c | 2 +- drivers/mtd/devices/m25p80.c | 1 + drivers/mtd/devices/mtd_dataflash.c | 1 - drivers/mtd/devices/spear_smi.c | 1 + drivers/mtd/devices/sst25l.c | 3 +-- drivers/mtd/lpddr/lpddr2_nvm.c | 1 + drivers/mtd/maps/bfin-async-flash.c | 1 + drivers/mtd/maps/gpio-addr-flash.c | 2 +- drivers/mtd/maps/intel_vr_nor.c | 2 +- drivers/mtd/maps/ixp4xx.c | 2 +- drivers/mtd/maps/lantiq-flash.c | 2 +- drivers/mtd/maps/latch-addr-flash.c | 2 +- drivers/mtd/maps/physmap.c | 1 - drivers/mtd/maps/physmap_of.c | 1 - drivers/mtd/maps/plat-ram.c | 1 - drivers/mtd/maps/pxa2xx-flash.c | 2 +- drivers/mtd/maps/rbtx4939-flash.c | 2 +- drivers/mtd/maps/sa1100-flash.c | 2 +- drivers/mtd/mtdcore.c | 11 ++++++++++- drivers/mtd/nand/atmel_nand.c | 2 +- drivers/mtd/nand/au1550nd.c | 2 +- drivers/mtd/nand/bcm47xxnflash/main.c | 2 +- drivers/mtd/nand/bf5xx_nand.c | 2 +- drivers/mtd/nand/cafe_nand.c | 1 - drivers/mtd/nand/davinci_nand.c | 3 --- drivers/mtd/nand/denali.c | 1 - drivers/mtd/nand/docg4.c | 2 +- drivers/mtd/nand/fsl_elbc_nand.c | 2 +- drivers/mtd/nand/fsl_ifc_nand.c | 2 +- drivers/mtd/nand/fsl_upm.c | 2 +- drivers/mtd/nand/fsmc_nand.c | 2 +- drivers/mtd/nand/gpio.c | 2 +- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- drivers/mtd/nand/hisi504_nand.c | 1 - drivers/mtd/nand/jz4740_nand.c | 2 +- drivers/mtd/nand/lpc32xx_mlc.c | 1 - drivers/mtd/nand/mpc5121_nfc.c | 1 + drivers/mtd/nand/mxc_nand.c | 1 - drivers/mtd/nand/ndfc.c | 2 +- drivers/mtd/nand/nuc900_nand.c | 2 +- drivers/mtd/nand/omap2.c | 3 +-- drivers/mtd/nand/orion_nand.c | 2 +- drivers/mtd/nand/pasemi_nand.c | 2 +- drivers/mtd/nand/plat_nand.c | 3 +-- drivers/mtd/nand/pxa3xx_nand.c | 2 +- drivers/mtd/nand/r852.c | 1 - drivers/mtd/nand/s3c2410.c | 2 +- drivers/mtd/nand/sh_flctl.c | 1 + drivers/mtd/nand/sharpsl.c | 2 +- drivers/mtd/nand/socrates_nand.c | 1 - drivers/mtd/nand/sunxi_nand.c | 1 - drivers/mtd/nand/tmio_nand.c | 1 + drivers/mtd/nand/txx9ndfmc.c | 2 +- drivers/mtd/onenand/generic.c | 3 +-- drivers/mtd/onenand/omap2.c | 2 -- drivers/mtd/onenand/samsung.c | 1 - drivers/mtd/spi-nor/fsl-quadspi.c | 1 + drivers/staging/mt29f_spinand/mt29f_spinand.c | 3 +-- 59 files changed, 56 insertions(+), 61 deletions(-)
Signature · 1 line
2.4.0
PATCH v2 1/60 mtd: core: tone down suggestion that dev.parent should be set
add_mtd_device() has a comment suggesting that the caller should have set dev.parent. This is required to have the parent device symlink show up in sysfs, but not for proper operation of the mtd device itself. Currently we have five drivers registering mtd devices during module initialization, so they don't actually provide a parent device to link to. That means we cannot WARN_ON() here, as it would trigger false positives.
Make the comment a bit less firm in its assertion that dev.parent should be set.
--- drivers/mtd/mtdcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/mtdcore.c +1 -1
@@ -423,7 +423,7 @@ int add_mtd_device(struct mtd_info *mtd) }/* Caller should have set dev.parent to match the -* physical device. +* physical device, if appropriate. */ mtd->dev.type = &mtd_devtype; mtd->dev.class = &mtd_class;
Signature · 1 line
2.4.0
PATCH v2 2/60 mtd: core: set some defaults when dev.parent is set
In reply to Frans KlaverIf a parent device is set, add_mtd_device() has enough knowledge to fill in some sane default values for the module name and owner. Do so if they aren't already set.
---
v1..v2
- Apparently we can get here without a driver set, causing a NULL dereference[0]. Check that a driver is there before copying the owner. It does mean that parent devices that don't seem to be having a driver lying around still can't produce an owner. I suppose the effect is not much different from it was before.
- Change wording of debug message to mention the fact we're talking about parent device symlinks here.
[0] https://lkml.org/lkml/2015/4/16/15
--- drivers/mtd/mtdcore.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/mtd/mtdcore.c +9 -0
@@ -413,6 +413,15 @@ int add_mtd_device(struct mtd_info *mtd) mtd->erasesize_mask = (1 << mtd->erasesize_shift) -1 ; mtd->writesize_mask = (1 << mtd->writesize_shift) -1 ; +if (mtd->dev.parent) { +if (!mtd->owner && mtd->dev.parent->driver) + mtd->owner = mtd->dev.parent->driver->owner; +if (!mtd->name) + mtd->name =dev_name (mtd->dev.parent); + }else { +pr_debug ("mtd device won't show a device symlink in sysfs\n" ); + } +/* Some chips always power up locked. Unlock them now */ if ((mtd->flags &MTD_WRITEABLE ) && (mtd->flags &MTD_POWERUP_LOCK )) { error =mtd_unlock (mtd,0 , mtd->size);
Signature · 1 line
2.4.0
PATCH v2 3/60 mtd: devices: bcm47xxflash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/devices/bcm47xxsflash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mtd/devices/bcm47xxsflash.c +4 -3
@@ -237,13 +237,14 @@ static int bcm47xxsflash_write(struct mtd_info *mtd, loff_t to, size_t len,return 0 ; } -static void bcm47xxsflash_fill_mtd (struct bcm47xxsflash *b47s) +static void bcm47xxsflash_fill_mtd (struct bcm47xxsflash *b47s, +struct device *dev) {struct mtd_info *mtd = &b47s->mtd; mtd->priv = b47s; + mtd->dev.parent = dev; mtd->name ="bcm47xxsflash" ; - mtd->owner =THIS_MODULE ; mtd->type =MTD_NORFLASH ; mtd->flags =MTD_CAP_NORFLASH ;
@@ -300,7 +301,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) b47s->blocksize = sflash->blocksize; b47s->numblocks = sflash->numblocks; b47s->size = sflash->size; -bcm47xxsflash_fill_mtd (b47s); +bcm47xxsflash_fill_mtd (b47s, &pdev->dev); err =mtd_device_parse_register (&b47s->mtd, probes,NULL ,NULL ,0 );if (err) {
Signature · 1 line
2.4.0
PATCH v2 4/60 mtd: devices: docg3: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/devices/docg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/devices/docg3.c +1 -1
@@ -1841,7 +1841,6 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd) mtd->erasesize /=2 ; mtd->writebufsize = mtd->writesize =DOC_LAYOUT_PAGE_SIZE ; mtd->oobsize =DOC_LAYOUT_OOB_SIZE ; - mtd->owner =THIS_MODULE ; mtd->_erase = doc_erase; mtd->_read = doc_read; mtd->_write = doc_write;
@@ -1881,6 +1880,7 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)if (!mtd) goto nomem2; mtd->priv = docg3; + mtd->dev.parent = dev; bbt_nbpages =DIV_ROUND_UP (docg3->max_block +1 ,8 *DOC_LAYOUT_PAGE_SIZE ); docg3->bbt =kzalloc (bbt_nbpages *DOC_LAYOUT_PAGE_SIZE ,GFP_KERNEL );
Signature · 1 line
2.4.0
PATCH v2 5/60 mtd: devices: m25p80: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
--- drivers/mtd/devices/m25p80.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/devices/m25p80.c +1 -0
@@ -206,6 +206,7 @@ static int m25p_probe(struct spi_device *spi)spi_set_drvdata (spi, flash); flash->mtd.priv = nor; + flash->mtd.dev.parent = &spi->dev; flash->spi = spi;if (spi->mode &SPI_RX_QUAD )
Signature · 1 line
2.4.0
Re: [PATCH v2 05/60] mtd: devices: m25p80: show parent device in sysfs
Quoted 3 lines · Frans Klaver
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
Signed-off-by Frans Klaver <[email protected]>
This is one of the patches that didn't apply...
drivers/mtd/devices/m25p80.c static int m25p_probe(struct spi_device *spi) · line 209
Quoted 13 lines
--- drivers/mtd/devices/m25p80.c | 1 + 1 file changed, 1 insertion(+)drivers/mtd/devices/m25p80.c +1
-0@@ -206,6 +206,7 @@ static int m25p_probe(struct spi_device *spi)spi_set_drvdata (spi, flash); flash->mtd.priv = nor; + flash->mtd.dev.parent = &spi->dev;
...but I don't think this patch is actually necessary. See spi_nor_scan(), which assigns mtd->dev.parent for us. So as long as the driver assigns the spi_nor::dev field, the spi-nor framework handles this for us.
Same comment applies to fsl-quadspi.c (patch 59), which also didn't apply cleanly. So I don't think we need either of these patches.
drivers/mtd/devices/m25p80.c static int m25p_probe(struct spi_device *spi) · line 212
Quoted 3 lines
drivers/mtd/devices/m25p80.c +0
-0flash->spi = spi;if (spi->mode &SPI_RX_QUAD )
Regards,
Brian
Re: [PATCH v2 05/60] mtd: devices: m25p80: show parent device in sysfs
Quoted 26 lines · Brian Norris
Quoted 3 lines · Frans Klaver
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
Signed-off-by Frans Klaver <[email protected]>This is one of the patches that didn't apply...
drivers/mtd/devices/m25p80.c static int m25p_probe(struct spi_device *spi) · line 209
Quoted 13 lines
--- drivers/mtd/devices/m25p80.c | 1 + 1 file changed, 1 insertion(+)drivers/mtd/devices/m25p80.c +1
-0@@ -206,6 +206,7 @@ static int m25p_probe(struct spi_device *spi)spi_set_drvdata (spi, flash); flash->mtd.priv = nor; + flash->mtd.dev.parent = &spi->dev;...but I don't think this patch is actually necessary. See
spi_nor_scan(), which assignsmtd->dev.parentfor us. So as long as the driver assigns thespi_nor::devfield, the spi-nor framework handles this for us.
Quoted 2 lines
Same comment applies to
fsl-quadspi.c(patch 59), which also didn't apply cleanly. So I don't think we need either of these patches.
Sure. Feel free to drop them. The main reason these patches exist is based on the fact that these files didn't contain the "dev.parent =" pattern. I tried to only add those necessary based on code inspection, so it is very well possible that we don't need them. If someone runs into it on these drivers, that's the time to fix it I guess.
Thanks,
Frans
PATCH v2 6/60 mtd: devices: mtd_dataflash: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/devices/mtd_dataflash.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/devices/mtd_dataflash.c +0 -1
@@ -647,7 +647,6 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages, device->size = nr_pages * pagesize; device->erasesize = pagesize; device->writesize = pagesize; - device->owner =THIS_MODULE ; device->type =MTD_DATAFLASH ; device->flags =MTD_WRITEABLE ; device->_erase = dataflash_erase;
Signature · 1 line
2.4.0
PATCH v2 7/60 mtd: devices: spear_smi: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
--- drivers/mtd/devices/spear_smi.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/devices/spear_smi.c +1 -0
@@ -854,6 +854,7 @@ static int spear_smi_setup_banks(struct platform_device *pdev,else flash->mtd.name = flash_devices[flash_index].name; + flash->mtd.dev.parent = &pdev->dev; flash->mtd.type =MTD_NORFLASH ; flash->mtd.writesize =1 ; flash->mtd.flags =MTD_CAP_NORFLASH ;
Signature · 1 line
2.4.0
PATCH v2 8/60 mtd: devices: sst251: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/devices/sst25l.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/devices/sst25l.c +1 -2
@@ -374,9 +374,8 @@ static int sst25l_probe(struct spi_device *spi) data =dev_get_platdata (&spi->dev);if (data && data->name) flash->mtd.name = data->name; -else - flash->mtd.name =dev_name (&spi->dev); + flash->mtd.dev.parent = &spi->dev; flash->mtd.type =MTD_NORFLASH ; flash->mtd.flags =MTD_CAP_NORFLASH ; flash->mtd.erasesize = flash_info->erase_size;
Signature · 1 line
2.4.0
PATCH v2 9/60 mtd: lpddr: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
--- drivers/mtd/lpddr/lpddr2_nvm.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/lpddr/lpddr2_nvm.c +1 -0
@@ -460,6 +460,7 @@ static int lpddr2_nvm_probe(struct platform_device *pdev)/* Populate mtd_info data structure */ *mtd = (struct mtd_info ) { + .dev = { .parent = &pdev->dev }, .name = pdev->dev.init_name, .type =MTD_RAM , .priv = map,
Signature · 1 line
2.4.0
PATCH v2 10/60 mtd: maps: bfin-async-flash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
--- drivers/mtd/maps/bfin-async-flash.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/maps/bfin-async-flash.c +1 -0
@@ -163,6 +163,7 @@ static int bfin_flash_probe(struct platform_device *pdev)kfree (state);return -ENXIO ; } + state->mtd.dev.parent = &pdev->dev;mtd_device_parse_register (state->mtd, part_probe_types,NULL , pdata->parts, pdata->nr_parts);
Signature · 1 line
2.4.0
PATCH v2 11/60 mtd: maps: gpio-addr-flash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
--- drivers/mtd/maps/gpio-addr-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/gpio-addr-flash.c +1 -1
@@ -266,7 +266,7 @@ static int gpio_flash_probe(struct platform_device *pdev)kfree (state);return -ENXIO ; } - + state->mtd->dev.parent = &pdev->dev;mtd_device_parse_register (state->mtd, part_probe_types,NULL , pdata->parts, pdata->nr_parts);
Signature · 1 line
2.4.0
PATCH v2 12/60 mtd: maps: intel_vr_nor: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/maps/intel_vr_nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/intel_vr_nor.c +1 -1
@@ -90,7 +90,7 @@ static int vr_nor_mtd_setup(struct vr_nor_mtd *p)if (!p->info)return -ENODEV ; - p->info->owner =THIS_MODULE ; + p->info->dev.parent = &p->dev->dev;return 0 ; }
Signature · 1 line
2.4.0
PATCH v2 13/60 mtd: maps: ixp4xx: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/maps/ixp4xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/ixp4xx.c +1 -1
@@ -226,7 +226,7 @@ static int ixp4xx_flash_probe(struct platform_device *dev) err = -ENXIO ; goto Error; } - info->mtd->owner =THIS_MODULE ; + info->mtd->dev.parent = &dev->dev;/* Use the fast version */ info->map.write = ixp4xx_write16;
Signature · 1 line
2.4.0
PATCH v2 14/60 mtd: maps: lantiq-flash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/maps/lantiq-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/lantiq-flash.c +1 -1
@@ -161,7 +161,7 @@ ltq_mtd_probe(struct platform_device *pdev)return -ENXIO ; } - ltq_mtd->mtd->owner =THIS_MODULE ; + ltq_mtd->mtd->dev.parent = &pdev->dev; cfi = ltq_mtd->map->fldrv_priv; cfi->addr_unlock1 ^=1 ;
Signature · 1 line
2.4.0
PATCH v2 15/60 mtd: maps: latch-addr-flash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/maps/latch-addr-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/latch-addr-flash.c +1 -1
@@ -195,7 +195,7 @@ static int latch_addr_flash_probe(struct platform_device *dev) err = -ENODEV ; goto iounmap; } - info->mtd->owner =THIS_MODULE ; + info->mtd->dev.parent = &dev->dev; mtd_device_parse_register(info->mtd, NULL, NULL, latch_addr_data->parts,
Signature · 1 line
2.4.0
PATCH v2 16/60 mtd: maps: physmap: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/maps/physmap.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/maps/physmap.c +0 -1
@@ -167,7 +167,6 @@ static int physmap_flash_probe(struct platform_device *dev) }else { devices_found++; } - info->mtd[i]->owner =THIS_MODULE ; info->mtd[i]->dev.parent = &dev->dev; }
Signature · 1 line
2.4.0
PATCH v2 17/60 mtd: maps: physmap_of: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/maps/physmap_of.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/maps/physmap_of.c +0 -1
@@ -288,7 +288,6 @@ static int of_flash_probe(struct platform_device *dev) }else { info->list_size++; } - info->list[i].mtd->owner =THIS_MODULE ; info->list[i].mtd->dev.parent = &dev->dev; }
Signature · 1 line
2.4.0
PATCH v2 18/60 mtd: maps: plat_ram: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/maps/plat-ram.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/maps/plat-ram.c +0 -1
@@ -210,7 +210,6 @@ static int platram_probe(struct platform_device *pdev) goto exit_free; } - info->mtd->owner =THIS_MODULE ; info->mtd->dev.parent = &pdev->dev;platram_setrw (info,PLATRAM_RW );
Signature · 1 line
2.4.0
PATCH v2 19/60 mtd: maps: pxa2xx-flash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/maps/pxa2xx-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/pxa2xx-flash.c +1 -1
@@ -93,7 +93,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev)iounmap (info->map.cached);return -EIO ; } - info->mtd->owner =THIS_MODULE ; + info->mtd->dev.parent = &pdev->dev;mtd_device_parse_register (info->mtd, probes,NULL , flash->parts, flash->nr_parts);
Signature · 1 line
2.4.0
PATCH v2 20/60 mtd: maps: rbtx4939-flash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/maps/rbtx4939-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/rbtx4939-flash.c +1 -1
@@ -96,7 +96,7 @@ static int rbtx4939_flash_probe(struct platform_device *dev) err = -ENXIO ; goto err_out; } - info->mtd->owner =THIS_MODULE ; + info->mtd.dev.parent = &dev->dev; err =mtd_device_parse_register (info->mtd,NULL ,NULL , pdata->parts, pdata->nr_parts);
Signature · 1 line
2.4.0
PATCH v2 21/60 mtd: maps: sa1100-flash: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore. Incidentally, it seems the owner field in the concatenated mtds is not actually used, so this shouldn't make much of a difference anyway.
--- drivers/mtd/maps/sa1100-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/sa1100-flash.c +1 -1
@@ -117,7 +117,6 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r ret = -ENXIO ; goto err; } - subdev->mtd->owner =THIS_MODULE ; printk(KERN_INFO "SA1100 flash: CFI device at 0x%08lx, %uMiB, %d-bit\n", phys, (unsigned)(subdev->mtd->size >> 20),
@@ -234,6 +233,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,if (info->mtd ==NULL ) ret = -ENXIO ; } + info->mtd->dev.parent = &pdev->dev;if (ret ==0 )return info;
Signature · 1 line
2.4.0
PATCH v2 22/60 mtd: nand: atmel_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/atmel_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/atmel_nand.c +1 -1
@@ -2126,7 +2126,7 @@ static int atmel_nand_probe(struct platform_device *pdev) nand_chip->priv = host;/* link the private data structures */ mtd->priv = nand_chip; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &pdev->dev;/* Set address of NAND IO lines */ nand_chip->IO_ADDR_R = host->io_base;
Signature · 1 line
2.4.0
PATCH v2 23/60 mtd: nand: au1550nd: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/au1550nd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/au1550nd.c +1 -1
@@ -439,7 +439,7 @@ static int au1550nd_probe(struct platform_device *pdev) this = &ctx->chip; ctx->info.priv = this; - ctx->info.owner =THIS_MODULE ; + ctx->info.dev.parent = &pdev->dev;/* figure out which CS# r->start belongs to */ cs =find_nand_cs (r->start);
Signature · 1 line
2.4.0
PATCH v2 24/60 mtd: nand: bcm47xxnflash: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/bcm47xxnflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/bcm47xxnflash/main.c +1 -1
@@ -34,7 +34,7 @@ static int bcm47xxnflash_probe(struct platform_device *pdev)return -ENOMEM ; b47n->nand_chip.priv = b47n; - b47n->mtd.owner =THIS_MODULE ; + b47n->mtd.dev.parent = &pdev->dev; b47n->mtd.priv = &b47n->nand_chip;/* Required */ b47n->cc = container_of(nflash, struct bcma_drv_cc, nflash);
Signature · 1 line
2.4.0
PATCH v2 25/60 mtd: nand: bf5xx_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/bf5xx_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/bf5xx_nand.c +1 -1
@@ -782,7 +782,7 @@ static int bf5xx_nand_probe(struct platform_device *pdev)/* initialise mtd info data struct */ mtd = &info->mtd; mtd->priv = chip; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &pdev->dev;/* initialise the hardware */ err =bf5xx_nand_hw_init (info);
Signature · 1 line
2.4.0
PATCH v2 26/60 mtd: nand: cafe_nand: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/cafe_nand.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/cafe_nand.c +0 -1
@@ -604,7 +604,6 @@ static int cafe_nand_probe(struct pci_dev *pdev, mtd->dev.parent = &pdev->dev; mtd->priv = cafe; - mtd->owner =THIS_MODULE ; cafe->pdev = pdev; cafe->mmio =pci_iomap (pdev,0 ,0 );
Signature · 1 line
2.4.0
PATCH v2 27/60 mtd: nand: davinci_nand: drop owner and name assignment
In reply to Frans KlaverOwner and name are automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/davinci_nand.c | 3 --- 1 file changed, 3 deletions(-)
drivers/mtd/nand/davinci_nand.c +0 -3
@@ -657,9 +657,6 @@ static int nand_davinci_probe(struct platform_device *pdev) info->vaddr = vaddr; info->mtd.priv = &info->chip; - info->mtd.name =dev_name (&pdev->dev); - info->mtd.owner =THIS_MODULE ; - info->mtd.dev.parent = &pdev->dev; info->chip.IO_ADDR_R = vaddr;
Signature · 1 line
2.4.0
PATCH v2 28/60 mtd: nand: denali: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/denali.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/denali.c +0 -1
@@ -1454,7 +1454,6 @@ int denali_init(struct denali_nand_info *denali)/* now that our ISR is registered, we can enable interrupts */ denali_set_intr_modes (denali, true); denali->mtd.name ="denali-nand" ; - denali->mtd.owner =THIS_MODULE ; denali->mtd.priv = &denali->nand;/* register the driver with the NAND core subsystem */
Signature · 1 line
2.4.0
PATCH v2 29/60 mtd: nand: docg4: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/docg4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/docg4.c +1 -1
@@ -1316,7 +1316,7 @@ static int __init probe_docg4(struct platform_device *pdev) doc = (struct docg4_priv *) (nand +1 ); mtd->priv = nand; nand->priv = doc; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &pdev->dev; doc->virtadr = virtadr; doc->dev = dev;
Signature · 1 line
2.4.0
PATCH v2 30/60 mtd: nand: fsl_elbc_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--
v1..v2
- fix build error
--- drivers/mtd/nand/fsl_elbc_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/fsl_elbc_nand.c +1 -1
@@ -747,7 +747,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)/* Fill in fsl_elbc_mtd structure */ priv->mtd.priv = chip; - priv->mtd.owner =THIS_MODULE ; + priv->mtd.dev.parent = priv->dev;/* set timeout to maximum */ priv->fmr =15 <<FMR_CWTO_SHIFT ;
Signature · 1 line
2.4.0
PATCH v2 31/60 mtd: nand: fsl_ifc_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner set by mtdcore.
--- drivers/mtd/nand/fsl_ifc_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/fsl_ifc_nand.c +1 -1
@@ -880,7 +880,7 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)/* Fill in fsl_ifc_mtd structure */ priv->mtd.priv = chip; - priv->mtd.owner =THIS_MODULE ; + priv->mtd.dev.parent = priv->dev;/* fill in nand_chip structure */ /* set up function call table */
Signature · 1 line
2.4.0
PATCH v2 32/60 mtd: nand: fsl_upm: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner set by mtdcore.
--- drivers/mtd/nand/fsl_upm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/fsl_upm.c +1 -1
@@ -176,7 +176,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun, fun->chip.dev_ready = fun_chip_ready; fun->mtd.priv = &fun->chip; - fun->mtd.owner =THIS_MODULE ; + fun->mtd.dev.parent = fun->dev; flash_np =of_get_next_child (upm_np,NULL );if (!flash_np)
Signature · 1 line
2.4.0
PATCH v2 33/60 mtd: nand: fsmc_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/fsmc_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/fsmc_nand.c +1 -1
@@ -1017,7 +1017,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) mtd->priv = nand; nand->priv = host; - host->mtd.owner =THIS_MODULE ; + host->mtd.dev.parent = &pdev->dev; nand->IO_ADDR_R = host->data_va; nand->IO_ADDR_W = host->data_va; nand->cmd_ctrl = fsmc_cmd_ctrl;
Signature · 1 line
2.4.0
PATCH v2 34/60 mtd: nand: gpio: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/gpio.c +1 -1
@@ -275,7 +275,7 @@ static int gpio_nand_probe(struct platform_device *pdev) chip->cmd_ctrl = gpio_nand_cmd_ctrl; gpiomtd->mtd_info.priv = chip; - gpiomtd->mtd_info.owner =THIS_MODULE ; + gpiomtd->mtd_info.dev.parent = &pdev->dev;platform_set_drvdata (pdev, gpiomtd);
Signature · 1 line
2.4.0
PATCH v2 35/60 mtd: nand: gpmi-nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner set by mtdcore.
--- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1 -1
@@ -1897,7 +1897,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)/* init the MTD data structures */ mtd->priv = chip; mtd->name ="gpmi-nand" ; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = this->dev;/* init the nand_chip{}, we don't support a 16-bit NAND Flash bus. */ chip->priv = this;
Signature · 1 line
2.4.0
PATCH v2 36/60 mtd: nand: hisi504_nand: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/hisi504_nand.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/hisi504_nand.c +0 -1
@@ -737,7 +737,6 @@ static int hisi_nfc_probe(struct platform_device *pdev) } mtd->priv = chip; - mtd->owner =THIS_MODULE ; mtd->name ="hisi_nand" ; mtd->dev.parent = &pdev->dev;
Signature · 1 line
2.4.0
PATCH v2 37/60 mtd: nand: jz4740_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/jz4740_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/jz4740_nand.c +1 -1
@@ -434,7 +434,7 @@ static int jz_nand_probe(struct platform_device *pdev) mtd = &nand->mtd; chip = &nand->chip; mtd->priv = chip; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &pdev->dev; mtd->name ="jz4740-nand" ; chip->ecc.hwctl = jz_nand_hwctl;
Signature · 1 line
2.4.0
PATCH v2 38/60 mtd: nand: lpc32xx_mlc: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/lpc32xx_mlc.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/lpc32xx_mlc.c +0 -1
@@ -682,7 +682,6 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) nand_chip->priv = host;/* link the private data structures */ mtd->priv = nand_chip; - mtd->owner =THIS_MODULE ; mtd->dev.parent = &pdev->dev;/* Get NAND clock */
Signature · 1 line
2.4.0
PATCH v2 39/60 mtd: nand: mpc5121_nfc: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
--- drivers/mtd/nand/mpc5121_nfc.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/mpc5121_nfc.c +1 -0
@@ -659,6 +659,7 @@ static int mpc5121_nfc_probe(struct platform_device *op) chip = &prv->chip; mtd->priv = chip; + mtd->dev.parent = dev; chip->priv = prv; prv->dev = dev;
Signature · 1 line
2.4.0
PATCH v2 40/60 mtd: nand: mxc_nand: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/mxc_nand.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/mxc_nand.c +0 -1
@@ -1450,7 +1450,6 @@ static int mxcnd_probe(struct platform_device *pdev) this = &host->nand; mtd = &host->mtd; mtd->priv = this; - mtd->owner =THIS_MODULE ; mtd->dev.parent = &pdev->dev; mtd->name =DRIVER_NAME ;
Signature · 1 line
2.4.0
PATCH v2 41/60 mtd: nand: ndfc: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner set by mtdcore.
--- drivers/mtd/nand/ndfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/ndfc.c +1 -1
@@ -171,7 +171,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, chip->priv = ndfc; ndfc->mtd.priv = chip; - ndfc->mtd.owner =THIS_MODULE ; + ndfc->mtd.dev.parent = &ndfc->ofdev->dev; flash_np =of_get_next_child (node,NULL );if (!flash_np)
Signature · 1 line
2.4.0
PATCH v2 42/60 mtd: nand: nuc900_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/nuc900_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nuc900_nand.c +1 -1
@@ -250,7 +250,7 @@ static int nuc900_nand_probe(struct platform_device *pdev) chip = &(nuc900_nand->chip); nuc900_nand->mtd.priv = chip; - nuc900_nand->mtd.owner =THIS_MODULE ; + nuc900_nand->mtd.dev.parent = &pdev->dev;spin_lock_init (&nuc900_nand->lock); nuc900_nand->clk =devm_clk_get (&pdev->dev,NULL );
Signature · 1 line
2.4.0
PATCH v2 43/60 mtd: nand: omap2: show parent device structure in sysfs
In reply to Frans KlaverMake sure the device structure is properly shown in sysfs by properly filling in dev.parent.
While at it, make use of the default owner and name values set by mtdcore.
--- drivers/mtd/nand/omap2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/nand/omap2.c +1 -2
@@ -1684,8 +1684,7 @@ static int omap_nand_probe(struct platform_device *pdev) info->ecc_opt = pdata->ecc_opt; mtd = &info->mtd; mtd->priv = &info->nand; - mtd->name =dev_name (&pdev->dev); - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &pdev->dev; nand_chip = &info->nand; nand_chip->ecc.priv =NULL ;
Signature · 1 line
2.4.0
PATCH v2 44/60 mtd: nand: orion_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/orion_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/orion_nand.c +1 -1
@@ -124,7 +124,7 @@ static int __init orion_nand_probe(struct platform_device *pdev) } mtd->priv = nc; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &pdev->dev; nc->priv = board; nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
Signature · 1 line
2.4.0
PATCH v2 45/60 mtd: nand: pasemi_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/pasemi_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/pasemi_nand.c +1 -1
@@ -124,7 +124,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)/* Link the private data with the MTD structure */ pasemi_nand_mtd->priv = chip; - pasemi_nand_mtd->owner =THIS_MODULE ; + pasemi_nand_mtd->dev.parent = &ofdev->dev; chip->IO_ADDR_R =of_iomap (np,0 ); chip->IO_ADDR_W = chip->IO_ADDR_R;
Signature · 1 line
2.4.0
PATCH v2 46/60 mtd: nand: plat_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner and name set by mtdcore.
--- drivers/mtd/nand/plat_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/nand/plat_nand.c +1 -2
@@ -61,8 +61,7 @@ static int plat_nand_probe(struct platform_device *pdev) data->chip.priv = &data; data->mtd.priv = &data->chip; - data->mtd.owner =THIS_MODULE ; - data->mtd.name =dev_name (&pdev->dev); + data->mtd.dev.parent = &pdev->dev; data->chip.IO_ADDR_R = data->io_base; data->chip.IO_ADDR_W = data->io_base;
Signature · 1 line
2.4.0
PATCH v2 47/60 mtd: nand: pxa3xx_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/pxa3xx_nand.c +1 -1
@@ -1639,7 +1639,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host->cs = cs; host->info_data = info; mtd->priv = host; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &pdev->dev; chip->ecc.read_page = pxa3xx_nand_read_page_hwecc; chip->ecc.write_page = pxa3xx_nand_write_page_hwecc;
Signature · 1 line
2.4.0
PATCH v2 48/60 mtd: nand: r852: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/r852.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/r852.c +0 -1
@@ -641,7 +641,6 @@ static int r852_register_nand_device(struct r852_device *dev)WARN_ON (dev->card_registred); - dev->mtd->owner =THIS_MODULE ; dev->mtd->priv = dev->chip; dev->mtd->dev.parent = &dev->pci_dev->dev;
Signature · 1 line
2.4.0
PATCH v2 49/60 mtd: nand: s3c2410: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner set by mtdcore.
--- drivers/mtd/nand/s3c2410.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/s3c2410.c +1 -1
@@ -832,7 +832,6 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, nmtd->info = info; nmtd->mtd.priv = chip; - nmtd->mtd.owner =THIS_MODULE ; nmtd->set = set;#ifdef CONFIG_MTD_NAND_S3C2410_HWECC
@@ -1016,6 +1015,7 @@ static int s3c24xx_nand_probe(struct platform_device *pdev)pr_debug ("initialising set %d (%p, info %p)\n" , setno, nmtd, info); + nmtd->mtd.dev.parent = &pdev->dev;s3c2410_nand_init_chip (info, nmtd, sets); nmtd->scan_res = nand_scan_ident(&nmtd->mtd,
Signature · 1 line
2.4.0
PATCH v2 50/60 mtd: nand: sh_flctl: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
--- drivers/mtd/nand/sh_flctl.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/sh_flctl.c +1 -0
@@ -1123,6 +1123,7 @@ static int flctl_probe(struct platform_device *pdev) flctl_mtd = &flctl->mtd; nand = &flctl->chip; flctl_mtd->priv = nand; + flctl_mtd->dev.parent = &pdev->dev; flctl->pdev = pdev; flctl->hwecc = pdata->has_hwecc; flctl->holden = pdata->use_holden;
Signature · 1 line
2.4.0
PATCH v2 51/60 mtd: nand: sharpsl: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/sharpsl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/sharpsl.c +1 -1
@@ -144,7 +144,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev)/* Link the private data with the MTD structure */ sharpsl->mtd.priv = this; - sharpsl->mtd.owner =THIS_MODULE ; + sharpsl->mtd.dev.parent = &pdev->dev;platform_set_drvdata (pdev, sharpsl);
Signature · 1 line
2.4.0
PATCH v2 52/60 mtd: nand: socrates_nand: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/socrates_nand.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/socrates_nand.c +0 -1
@@ -167,7 +167,6 @@ static int socrates_nand_probe(struct platform_device *ofdev) nand_chip->priv = host;/* link the private data structures */ mtd->priv = nand_chip; mtd->name ="socrates_nand" ; - mtd->owner =THIS_MODULE ; mtd->dev.parent = &ofdev->dev; ppdata.of_node = ofdev->dev.of_node;
Signature · 1 line
2.4.0
PATCH v2 53/60 mtd: nand: sunxi_nand: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/nand/sunxi_nand.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/nand/sunxi_nand.c +0 -1
@@ -1245,7 +1245,6 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc, mtd = &chip->mtd; mtd->dev.parent = dev; mtd->priv = nand; - mtd->owner =THIS_MODULE ; ret =nand_scan_ident (mtd, nsels,NULL );if (ret)
Signature · 1 line
2.4.0
PATCH v2 54/60 mtd: nand: tmio_nand: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
--- drivers/mtd/nand/tmio_nand.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/tmio_nand.c +1 -0
@@ -382,6 +382,7 @@ static int tmio_probe(struct platform_device *dev) nand_chip = &tmio->chip; mtd->priv = nand_chip; mtd->name ="tmio-nand" ; + mtd->dev.parent = &dev->dev; tmio->ccr =devm_ioremap (&dev->dev, ccr->start,resource_size (ccr));if (!tmio->ccr)
Signature · 1 line
2.4.0
PATCH v2 55/60 mtd: nand: txx9ndfmc: show parent device in sysfs
In reply to Frans KlaverFix a bug where parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
--- drivers/mtd/nand/txx9ndfmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/txx9ndfmc.c +1 -1
@@ -323,7 +323,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev)continue ; chip = &txx9_priv->chip; mtd = &txx9_priv->mtd; - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &dev->dev; mtd->priv = chip;
Signature · 1 line
2.4.0
PATCH v2 56/60 mtd: onenand: generic: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, take advantage of the default owner and name values set by mtdcore.
--- drivers/mtd/onenand/generic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/onenand/generic.c +1 -2
@@ -60,9 +60,8 @@ static int generic_onenand_probe(struct platform_device *pdev) info->onenand.mmcontrol = pdata ? pdata->mmcontrol :NULL ; info->onenand.irq =platform_get_irq (pdev,0 ); - info->mtd.name =dev_name (&pdev->dev); + info->mtd.dev.parent = &pdev->dev; info->mtd.priv = &info->onenand; - info->mtd.owner =THIS_MODULE ;if (onenand_scan (&info->mtd,1 )) { err = -ENXIO ;
Signature · 1 line
2.4.0
PATCH v2 57/60 mtd: onenand: omap2: drop owner and name assignment
In reply to Frans KlaverOwner and name are automatically set by mtdcore. Make use of that.
--- drivers/mtd/onenand/omap2.c | 2 -- 1 file changed, 2 deletions(-)
drivers/mtd/onenand/omap2.c +0 -2
@@ -710,9 +710,7 @@ static int omap2_onenand_probe(struct platform_device *pdev) c->onenand.base, c->freq); c->pdev = pdev; - c->mtd.name =dev_name (&pdev->dev); c->mtd.priv = &c->onenand; - c->mtd.owner =THIS_MODULE ; c->mtd.dev.parent = &pdev->dev;
Signature · 1 line
2.4.0
PATCH v2 58/60 mtd: onenand: samsung: drop owner assignment
In reply to Frans KlaverOwner is automatically set by mtdcore. Make use of that.
--- drivers/mtd/onenand/samsung.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/onenand/samsung.c +0 -1
@@ -864,7 +864,6 @@ static int s3c_onenand_probe(struct platform_device *pdev) this = (struct onenand_chip *) &mtd[1 ]; mtd->priv = this; mtd->dev.parent = &pdev->dev; - mtd->owner =THIS_MODULE ; onenand->pdev = pdev; onenand->type =platform_get_device_id (pdev)->driver_data;
Signature · 1 line
2.4.0
PATCH v2 59/60 mtd: spi-nor: fsl-quadspi: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
--- drivers/mtd/spi-nor/fsl-quadspi.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/spi-nor/fsl-quadspi.c +1 -0
@@ -874,6 +874,7 @@ static int fsl_qspi_probe(struct platform_device *pdev) nor = &q->nor[i]; mtd = &q->mtd[i]; + mtd->dev.parent = dev; nor->mtd = mtd; nor->dev = dev;
Signature · 1 line
2.4.0
PATCH v2 60/60 staging: mt29f_spinand: show parent device in sysfs
In reply to Frans KlaverFix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, take advantage of the default owner and name values set by mtdcore.
--- drivers/staging/mt29f_spinand/mt29f_spinand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/mt29f_spinand/mt29f_spinand.c +1 -2
@@ -912,8 +912,7 @@ static int spinand_probe(struct spi_device *spi_nand)dev_set_drvdata (&spi_nand->dev, mtd); mtd->priv = chip; - mtd->name =dev_name (&spi_nand->dev); - mtd->owner =THIS_MODULE ; + mtd->dev.parent = &spi_nand->dev; mtd->oobsize =64 ;if (nand_scan (mtd,1 ))
Signature · 1 line
2.4.0
Quoted 1 line · Frans Klaver
- Fix compile error in 30: "
fsmc_nand: show parent device in sysfs"
Oh dear, that should have been fsl_elbc_nand.
Frans
Hi Frans,
Quoted 17 lines · Frans Klaver
Here's the second iteration of a series stemming from a previous discussion about mtd devices not showing up in sysfs properly[1]. While the original series 27 patches, this one should cover all drivers that suffer from this issue, and shamelessly hits 60. Again, if it's preferred that the patches are grouped differently, like by mtd subdir, I'd be happy to resend. Until then, we'll make do with this.
This series teaches
add_mtd_device()to set name and owner based on the set parent device, if dev.parent is filled in, and name resp. owner isn't already filled in. All drivers that I could find that don't set the parent are touched to set the parent device, and remove the name and owner assignment in cases where I'm sure the resulting name will not change. Only the latter is done in cases where I would find the driver explicitly filling in the owner.Thanks for having a go at your favorite MTD,
Frans
Quoted 8 lines
v1..v2
- Overall: make it more clear that it's about a parent device symlink gone missing (thanks, Brian)
- Fix compile error in 30: "fsmc_nand: show parent device in sysfs"
- Fix possible null-pointer dereference in 02: "mtd: core: set somedefaults..."
Thanks for the patches. I've tested a few drivers and compile tested as much as I can, and everything looks good. Patches 5 and 59 (m25p80.c and fsl-quadspi.c) didn't apply cleanly yet, as those drivers have had some concurrent changes, so I didn't take them yet. If it's trivial to fix up, I'll apply themself. Stay tuned.
Regards,
Brian