diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-12-23 05:00:14 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-12-23 05:00:14 -0500 |
commit | 160bbab3000dafccbe43688e48208cecf4deb879 (patch) | |
tree | 64e978ecc07d9d1f1a1345db40fc50e818321d57 /drivers/mtd/devices | |
parent | d85316ac459f1cdd14ea1828eebeac1f1028e167 (diff) |
[MTD] struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 20 | ||||
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 32 |
2 files changed, 26 insertions, 26 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 9be0229c3d30..7c3fc766dcf1 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -171,8 +171,8 @@ static int wait_till_ready(struct m25p *flash) | |||
171 | static int erase_chip(struct m25p *flash) | 171 | static int erase_chip(struct m25p *flash) |
172 | { | 172 | { |
173 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %lldKiB\n", | 173 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %lldKiB\n", |
174 | flash->spi->dev.bus_id, __func__, | 174 | dev_name(&flash->spi->dev), __func__, |
175 | (long long)(flash->mtd.size >> 10)); | 175 | (long long)(flash->mtd.size >> 10)); |
176 | 176 | ||
177 | /* Wait until finished previous write command. */ | 177 | /* Wait until finished previous write command. */ |
178 | if (wait_till_ready(flash)) | 178 | if (wait_till_ready(flash)) |
@@ -198,7 +198,7 @@ static int erase_chip(struct m25p *flash) | |||
198 | static int erase_sector(struct m25p *flash, u32 offset) | 198 | static int erase_sector(struct m25p *flash, u32 offset) |
199 | { | 199 | { |
200 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n", | 200 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n", |
201 | flash->spi->dev.bus_id, __func__, | 201 | dev_name(&flash->spi->dev), __func__, |
202 | flash->mtd.erasesize / 1024, offset); | 202 | flash->mtd.erasesize / 1024, offset); |
203 | 203 | ||
204 | /* Wait until finished previous write command. */ | 204 | /* Wait until finished previous write command. */ |
@@ -236,8 +236,8 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
236 | uint32_t rem; | 236 | uint32_t rem; |
237 | 237 | ||
238 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%llx, len %lld\n", | 238 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%llx, len %lld\n", |
239 | flash->spi->dev.bus_id, __func__, "at", | 239 | dev_name(&flash->spi->dev), __func__, "at", |
240 | (long long)instr->addr, (long long)instr->len); | 240 | (long long)instr->addr, (long long)instr->len); |
241 | 241 | ||
242 | /* sanity checks */ | 242 | /* sanity checks */ |
243 | if (instr->addr + instr->len > flash->mtd.size) | 243 | if (instr->addr + instr->len > flash->mtd.size) |
@@ -296,7 +296,7 @@ static int m25p80_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
296 | struct spi_message m; | 296 | struct spi_message m; |
297 | 297 | ||
298 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", | 298 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", |
299 | flash->spi->dev.bus_id, __func__, "from", | 299 | dev_name(&flash->spi->dev), __func__, "from", |
300 | (u32)from, len); | 300 | (u32)from, len); |
301 | 301 | ||
302 | /* sanity checks */ | 302 | /* sanity checks */ |
@@ -368,7 +368,7 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
368 | struct spi_message m; | 368 | struct spi_message m; |
369 | 369 | ||
370 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", | 370 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", |
371 | flash->spi->dev.bus_id, __func__, "to", | 371 | dev_name(&flash->spi->dev), __func__, "to", |
372 | (u32)to, len); | 372 | (u32)to, len); |
373 | 373 | ||
374 | if (retlen) | 374 | if (retlen) |
@@ -564,7 +564,7 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi) | |||
564 | tmp = spi_write_then_read(spi, &code, 1, id, 5); | 564 | tmp = spi_write_then_read(spi, &code, 1, id, 5); |
565 | if (tmp < 0) { | 565 | if (tmp < 0) { |
566 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", | 566 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", |
567 | spi->dev.bus_id, tmp); | 567 | dev_name(&spi->dev), tmp); |
568 | return NULL; | 568 | return NULL; |
569 | } | 569 | } |
570 | jedec = id[0]; | 570 | jedec = id[0]; |
@@ -618,7 +618,7 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
618 | /* unrecognized chip? */ | 618 | /* unrecognized chip? */ |
619 | if (i == ARRAY_SIZE(m25p_data)) { | 619 | if (i == ARRAY_SIZE(m25p_data)) { |
620 | DEBUG(MTD_DEBUG_LEVEL0, "%s: unrecognized id %s\n", | 620 | DEBUG(MTD_DEBUG_LEVEL0, "%s: unrecognized id %s\n", |
621 | spi->dev.bus_id, data->type); | 621 | dev_name(&spi->dev), data->type); |
622 | info = NULL; | 622 | info = NULL; |
623 | 623 | ||
624 | /* recognized; is that chip really what's there? */ | 624 | /* recognized; is that chip really what's there? */ |
@@ -659,7 +659,7 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
659 | if (data && data->name) | 659 | if (data && data->name) |
660 | flash->mtd.name = data->name; | 660 | flash->mtd.name = data->name; |
661 | else | 661 | else |
662 | flash->mtd.name = spi->dev.bus_id; | 662 | flash->mtd.name = dev_name(&spi->dev); |
663 | 663 | ||
664 | flash->mtd.type = MTD_NORFLASH; | 664 | flash->mtd.type = MTD_NORFLASH; |
665 | flash->mtd.writesize = 1; | 665 | flash->mtd.writesize = 1; |
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 68068975940b..d44f741ae229 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -129,7 +129,7 @@ static int dataflash_waitready(struct spi_device *spi) | |||
129 | status = dataflash_status(spi); | 129 | status = dataflash_status(spi); |
130 | if (status < 0) { | 130 | if (status < 0) { |
131 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status %d?\n", | 131 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status %d?\n", |
132 | spi->dev.bus_id, status); | 132 | dev_name(&spi->dev), status); |
133 | status = 0; | 133 | status = 0; |
134 | } | 134 | } |
135 | 135 | ||
@@ -156,8 +156,8 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
156 | uint32_t rem; | 156 | uint32_t rem; |
157 | 157 | ||
158 | DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%llx len 0x%llx\n", | 158 | DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%llx len 0x%llx\n", |
159 | spi->dev.bus_id, (long long)instr->addr, | 159 | dev_name(&spi->dev), (long long)instr->addr, |
160 | (long long)instr->len); | 160 | (long long)instr->len); |
161 | 161 | ||
162 | /* Sanity checks */ | 162 | /* Sanity checks */ |
163 | if (instr->addr + instr->len > mtd->size) | 163 | if (instr->addr + instr->len > mtd->size) |
@@ -203,7 +203,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
203 | 203 | ||
204 | if (status < 0) { | 204 | if (status < 0) { |
205 | printk(KERN_ERR "%s: erase %x, err %d\n", | 205 | printk(KERN_ERR "%s: erase %x, err %d\n", |
206 | spi->dev.bus_id, pageaddr, status); | 206 | dev_name(&spi->dev), pageaddr, status); |
207 | /* REVISIT: can retry instr->retries times; or | 207 | /* REVISIT: can retry instr->retries times; or |
208 | * giveup and instr->fail_addr = instr->addr; | 208 | * giveup and instr->fail_addr = instr->addr; |
209 | */ | 209 | */ |
@@ -245,7 +245,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
245 | int status; | 245 | int status; |
246 | 246 | ||
247 | DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", | 247 | DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", |
248 | priv->spi->dev.bus_id, (unsigned)from, (unsigned)(from + len)); | 248 | dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len)); |
249 | 249 | ||
250 | *retlen = 0; | 250 | *retlen = 0; |
251 | 251 | ||
@@ -294,7 +294,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
294 | status = 0; | 294 | status = 0; |
295 | } else | 295 | } else |
296 | DEBUG(MTD_DEBUG_LEVEL1, "%s: read %x..%x --> %d\n", | 296 | DEBUG(MTD_DEBUG_LEVEL1, "%s: read %x..%x --> %d\n", |
297 | priv->spi->dev.bus_id, | 297 | dev_name(&priv->spi->dev), |
298 | (unsigned)from, (unsigned)(from + len), | 298 | (unsigned)from, (unsigned)(from + len), |
299 | status); | 299 | status); |
300 | return status; | 300 | return status; |
@@ -321,7 +321,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
321 | uint8_t *command; | 321 | uint8_t *command; |
322 | 322 | ||
323 | DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", | 323 | DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", |
324 | spi->dev.bus_id, (unsigned)to, (unsigned)(to + len)); | 324 | dev_name(&spi->dev), (unsigned)to, (unsigned)(to + len)); |
325 | 325 | ||
326 | *retlen = 0; | 326 | *retlen = 0; |
327 | 327 | ||
@@ -380,7 +380,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
380 | status = spi_sync(spi, &msg); | 380 | status = spi_sync(spi, &msg); |
381 | if (status < 0) | 381 | if (status < 0) |
382 | DEBUG(MTD_DEBUG_LEVEL1, "%s: xfer %u -> %d \n", | 382 | DEBUG(MTD_DEBUG_LEVEL1, "%s: xfer %u -> %d \n", |
383 | spi->dev.bus_id, addr, status); | 383 | dev_name(&spi->dev), addr, status); |
384 | 384 | ||
385 | (void) dataflash_waitready(priv->spi); | 385 | (void) dataflash_waitready(priv->spi); |
386 | } | 386 | } |
@@ -402,7 +402,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
402 | spi_transfer_del(x + 1); | 402 | spi_transfer_del(x + 1); |
403 | if (status < 0) | 403 | if (status < 0) |
404 | DEBUG(MTD_DEBUG_LEVEL1, "%s: pgm %u/%u -> %d \n", | 404 | DEBUG(MTD_DEBUG_LEVEL1, "%s: pgm %u/%u -> %d \n", |
405 | spi->dev.bus_id, addr, writelen, status); | 405 | dev_name(&spi->dev), addr, writelen, status); |
406 | 406 | ||
407 | (void) dataflash_waitready(priv->spi); | 407 | (void) dataflash_waitready(priv->spi); |
408 | 408 | ||
@@ -422,14 +422,14 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
422 | status = spi_sync(spi, &msg); | 422 | status = spi_sync(spi, &msg); |
423 | if (status < 0) | 423 | if (status < 0) |
424 | DEBUG(MTD_DEBUG_LEVEL1, "%s: compare %u -> %d \n", | 424 | DEBUG(MTD_DEBUG_LEVEL1, "%s: compare %u -> %d \n", |
425 | spi->dev.bus_id, addr, status); | 425 | dev_name(&spi->dev), addr, status); |
426 | 426 | ||
427 | status = dataflash_waitready(priv->spi); | 427 | status = dataflash_waitready(priv->spi); |
428 | 428 | ||
429 | /* Check result of the compare operation */ | 429 | /* Check result of the compare operation */ |
430 | if (status & (1 << 6)) { | 430 | if (status & (1 << 6)) { |
431 | printk(KERN_ERR "%s: compare page %u, err %d\n", | 431 | printk(KERN_ERR "%s: compare page %u, err %d\n", |
432 | spi->dev.bus_id, pageaddr, status); | 432 | dev_name(&spi->dev), pageaddr, status); |
433 | remaining = 0; | 433 | remaining = 0; |
434 | status = -EIO; | 434 | status = -EIO; |
435 | break; | 435 | break; |
@@ -785,7 +785,7 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi) | |||
785 | tmp = spi_write_then_read(spi, &code, 1, id, 3); | 785 | tmp = spi_write_then_read(spi, &code, 1, id, 3); |
786 | if (tmp < 0) { | 786 | if (tmp < 0) { |
787 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", | 787 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", |
788 | spi->dev.bus_id, tmp); | 788 | dev_name(&spi->dev), tmp); |
789 | return ERR_PTR(tmp); | 789 | return ERR_PTR(tmp); |
790 | } | 790 | } |
791 | if (id[0] != 0x1f) | 791 | if (id[0] != 0x1f) |
@@ -875,7 +875,7 @@ static int __devinit dataflash_probe(struct spi_device *spi) | |||
875 | status = dataflash_status(spi); | 875 | status = dataflash_status(spi); |
876 | if (status <= 0 || status == 0xff) { | 876 | if (status <= 0 || status == 0xff) { |
877 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", | 877 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", |
878 | spi->dev.bus_id, status); | 878 | dev_name(&spi->dev), status); |
879 | if (status == 0 || status == 0xff) | 879 | if (status == 0 || status == 0xff) |
880 | status = -ENODEV; | 880 | status = -ENODEV; |
881 | return status; | 881 | return status; |
@@ -911,13 +911,13 @@ static int __devinit dataflash_probe(struct spi_device *spi) | |||
911 | /* obsolete AT45DB1282 not (yet?) supported */ | 911 | /* obsolete AT45DB1282 not (yet?) supported */ |
912 | default: | 912 | default: |
913 | DEBUG(MTD_DEBUG_LEVEL1, "%s: unsupported device (%x)\n", | 913 | DEBUG(MTD_DEBUG_LEVEL1, "%s: unsupported device (%x)\n", |
914 | spi->dev.bus_id, status & 0x3c); | 914 | dev_name(&spi->dev), status & 0x3c); |
915 | status = -ENODEV; | 915 | status = -ENODEV; |
916 | } | 916 | } |
917 | 917 | ||
918 | if (status < 0) | 918 | if (status < 0) |
919 | DEBUG(MTD_DEBUG_LEVEL1, "%s: add_dataflash --> %d\n", | 919 | DEBUG(MTD_DEBUG_LEVEL1, "%s: add_dataflash --> %d\n", |
920 | spi->dev.bus_id, status); | 920 | dev_name(&spi->dev), status); |
921 | 921 | ||
922 | return status; | 922 | return status; |
923 | } | 923 | } |
@@ -927,7 +927,7 @@ static int __devexit dataflash_remove(struct spi_device *spi) | |||
927 | struct dataflash *flash = dev_get_drvdata(&spi->dev); | 927 | struct dataflash *flash = dev_get_drvdata(&spi->dev); |
928 | int status; | 928 | int status; |
929 | 929 | ||
930 | DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", spi->dev.bus_id); | 930 | DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", dev_name(&spi->dev)); |
931 | 931 | ||
932 | if (mtd_has_partitions() && flash->partitioned) | 932 | if (mtd_has_partitions() && flash->partitioned) |
933 | status = del_mtd_partitions(&flash->mtd); | 933 | status = del_mtd_partitions(&flash->mtd); |