diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-01-06 13:44:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 13:44:38 -0500 |
commit | 475b44c19913b877537c8bc19799f75b0b142641 (patch) | |
tree | 4049c6a9e17cb62761b9b4b0eb92bf60786af73f /drivers/mtd/devices | |
parent | 24d254759dc4eb59b47317790c05569f732a2577 (diff) |
mtd: struct device - replace bus_id with dev_name(), dev_set_name()
CC: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 16 | ||||
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 30 |
2 files changed, 23 insertions, 23 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 6659b2275c0c..5733f0643843 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -170,7 +170,7 @@ static int wait_till_ready(struct m25p *flash) | |||
170 | static int erase_chip(struct m25p *flash) | 170 | static int erase_chip(struct m25p *flash) |
171 | { | 171 | { |
172 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n", | 172 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n", |
173 | flash->spi->dev.bus_id, __func__, | 173 | dev_name(&flash->spi->dev), __func__, |
174 | flash->mtd.size / 1024); | 174 | flash->mtd.size / 1024); |
175 | 175 | ||
176 | /* Wait until finished previous write command. */ | 176 | /* Wait until finished previous write command. */ |
@@ -197,7 +197,7 @@ static int erase_chip(struct m25p *flash) | |||
197 | static int erase_sector(struct m25p *flash, u32 offset) | 197 | static int erase_sector(struct m25p *flash, u32 offset) |
198 | { | 198 | { |
199 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n", | 199 | DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n", |
200 | flash->spi->dev.bus_id, __func__, | 200 | dev_name(&flash->spi->dev), __func__, |
201 | flash->mtd.erasesize / 1024, offset); | 201 | flash->mtd.erasesize / 1024, offset); |
202 | 202 | ||
203 | /* Wait until finished previous write command. */ | 203 | /* Wait until finished previous write command. */ |
@@ -234,7 +234,7 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
234 | u32 addr,len; | 234 | u32 addr,len; |
235 | 235 | ||
236 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %d\n", | 236 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %d\n", |
237 | flash->spi->dev.bus_id, __func__, "at", | 237 | dev_name(&flash->spi->dev), __func__, "at", |
238 | (u32)instr->addr, instr->len); | 238 | (u32)instr->addr, instr->len); |
239 | 239 | ||
240 | /* sanity checks */ | 240 | /* sanity checks */ |
@@ -295,7 +295,7 @@ static int m25p80_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
295 | struct spi_message m; | 295 | struct spi_message m; |
296 | 296 | ||
297 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", | 297 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", |
298 | flash->spi->dev.bus_id, __func__, "from", | 298 | dev_name(&flash->spi->dev), __func__, "from", |
299 | (u32)from, len); | 299 | (u32)from, len); |
300 | 300 | ||
301 | /* sanity checks */ | 301 | /* sanity checks */ |
@@ -367,7 +367,7 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
367 | struct spi_message m; | 367 | struct spi_message m; |
368 | 368 | ||
369 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", | 369 | DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", |
370 | flash->spi->dev.bus_id, __func__, "to", | 370 | dev_name(&flash->spi->dev), __func__, "to", |
371 | (u32)to, len); | 371 | (u32)to, len); |
372 | 372 | ||
373 | if (retlen) | 373 | if (retlen) |
@@ -563,7 +563,7 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi) | |||
563 | tmp = spi_write_then_read(spi, &code, 1, id, 5); | 563 | tmp = spi_write_then_read(spi, &code, 1, id, 5); |
564 | if (tmp < 0) { | 564 | if (tmp < 0) { |
565 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", | 565 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", |
566 | spi->dev.bus_id, tmp); | 566 | dev_name(&spi->dev), tmp); |
567 | return NULL; | 567 | return NULL; |
568 | } | 568 | } |
569 | jedec = id[0]; | 569 | jedec = id[0]; |
@@ -617,7 +617,7 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
617 | /* unrecognized chip? */ | 617 | /* unrecognized chip? */ |
618 | if (i == ARRAY_SIZE(m25p_data)) { | 618 | if (i == ARRAY_SIZE(m25p_data)) { |
619 | DEBUG(MTD_DEBUG_LEVEL0, "%s: unrecognized id %s\n", | 619 | DEBUG(MTD_DEBUG_LEVEL0, "%s: unrecognized id %s\n", |
620 | spi->dev.bus_id, data->type); | 620 | dev_name(&spi->dev), data->type); |
621 | info = NULL; | 621 | info = NULL; |
622 | 622 | ||
623 | /* recognized; is that chip really what's there? */ | 623 | /* recognized; is that chip really what's there? */ |
@@ -658,7 +658,7 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
658 | if (data && data->name) | 658 | if (data && data->name) |
659 | flash->mtd.name = data->name; | 659 | flash->mtd.name = data->name; |
660 | else | 660 | else |
661 | flash->mtd.name = spi->dev.bus_id; | 661 | flash->mtd.name = dev_name(&spi->dev); |
662 | 662 | ||
663 | flash->mtd.type = MTD_NORFLASH; | 663 | flash->mtd.type = MTD_NORFLASH; |
664 | flash->mtd.writesize = 1; | 664 | flash->mtd.writesize = 1; |
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 6dd9aff8bb2d..65126cd668ff 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -128,7 +128,7 @@ static int dataflash_waitready(struct spi_device *spi) | |||
128 | status = dataflash_status(spi); | 128 | status = dataflash_status(spi); |
129 | if (status < 0) { | 129 | if (status < 0) { |
130 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status %d?\n", | 130 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status %d?\n", |
131 | spi->dev.bus_id, status); | 131 | dev_name(&spi->dev), status); |
132 | status = 0; | 132 | status = 0; |
133 | } | 133 | } |
134 | 134 | ||
@@ -154,7 +154,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
154 | uint8_t *command; | 154 | uint8_t *command; |
155 | 155 | ||
156 | DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n", | 156 | DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n", |
157 | spi->dev.bus_id, | 157 | dev_name(&spi->dev), |
158 | instr->addr, instr->len); | 158 | instr->addr, instr->len); |
159 | 159 | ||
160 | /* Sanity checks */ | 160 | /* Sanity checks */ |
@@ -197,7 +197,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
197 | 197 | ||
198 | if (status < 0) { | 198 | if (status < 0) { |
199 | printk(KERN_ERR "%s: erase %x, err %d\n", | 199 | printk(KERN_ERR "%s: erase %x, err %d\n", |
200 | spi->dev.bus_id, pageaddr, status); | 200 | dev_name(&spi->dev), pageaddr, status); |
201 | /* REVISIT: can retry instr->retries times; or | 201 | /* REVISIT: can retry instr->retries times; or |
202 | * giveup and instr->fail_addr = instr->addr; | 202 | * giveup and instr->fail_addr = instr->addr; |
203 | */ | 203 | */ |
@@ -239,7 +239,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
239 | int status; | 239 | int status; |
240 | 240 | ||
241 | DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", | 241 | DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", |
242 | priv->spi->dev.bus_id, (unsigned)from, (unsigned)(from + len)); | 242 | dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len)); |
243 | 243 | ||
244 | *retlen = 0; | 244 | *retlen = 0; |
245 | 245 | ||
@@ -288,7 +288,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
288 | status = 0; | 288 | status = 0; |
289 | } else | 289 | } else |
290 | DEBUG(MTD_DEBUG_LEVEL1, "%s: read %x..%x --> %d\n", | 290 | DEBUG(MTD_DEBUG_LEVEL1, "%s: read %x..%x --> %d\n", |
291 | priv->spi->dev.bus_id, | 291 | dev_name(&priv->spi->dev), |
292 | (unsigned)from, (unsigned)(from + len), | 292 | (unsigned)from, (unsigned)(from + len), |
293 | status); | 293 | status); |
294 | return status; | 294 | return status; |
@@ -315,7 +315,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
315 | uint8_t *command; | 315 | uint8_t *command; |
316 | 316 | ||
317 | DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", | 317 | DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", |
318 | spi->dev.bus_id, (unsigned)to, (unsigned)(to + len)); | 318 | dev_name(&spi->dev), (unsigned)to, (unsigned)(to + len)); |
319 | 319 | ||
320 | *retlen = 0; | 320 | *retlen = 0; |
321 | 321 | ||
@@ -374,7 +374,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
374 | status = spi_sync(spi, &msg); | 374 | status = spi_sync(spi, &msg); |
375 | if (status < 0) | 375 | if (status < 0) |
376 | DEBUG(MTD_DEBUG_LEVEL1, "%s: xfer %u -> %d \n", | 376 | DEBUG(MTD_DEBUG_LEVEL1, "%s: xfer %u -> %d \n", |
377 | spi->dev.bus_id, addr, status); | 377 | dev_name(&spi->dev), addr, status); |
378 | 378 | ||
379 | (void) dataflash_waitready(priv->spi); | 379 | (void) dataflash_waitready(priv->spi); |
380 | } | 380 | } |
@@ -396,7 +396,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
396 | spi_transfer_del(x + 1); | 396 | spi_transfer_del(x + 1); |
397 | if (status < 0) | 397 | if (status < 0) |
398 | DEBUG(MTD_DEBUG_LEVEL1, "%s: pgm %u/%u -> %d \n", | 398 | DEBUG(MTD_DEBUG_LEVEL1, "%s: pgm %u/%u -> %d \n", |
399 | spi->dev.bus_id, addr, writelen, status); | 399 | dev_name(&spi->dev), addr, writelen, status); |
400 | 400 | ||
401 | (void) dataflash_waitready(priv->spi); | 401 | (void) dataflash_waitready(priv->spi); |
402 | 402 | ||
@@ -416,14 +416,14 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
416 | status = spi_sync(spi, &msg); | 416 | status = spi_sync(spi, &msg); |
417 | if (status < 0) | 417 | if (status < 0) |
418 | DEBUG(MTD_DEBUG_LEVEL1, "%s: compare %u -> %d \n", | 418 | DEBUG(MTD_DEBUG_LEVEL1, "%s: compare %u -> %d \n", |
419 | spi->dev.bus_id, addr, status); | 419 | dev_name(&spi->dev), addr, status); |
420 | 420 | ||
421 | status = dataflash_waitready(priv->spi); | 421 | status = dataflash_waitready(priv->spi); |
422 | 422 | ||
423 | /* Check result of the compare operation */ | 423 | /* Check result of the compare operation */ |
424 | if (status & (1 << 6)) { | 424 | if (status & (1 << 6)) { |
425 | printk(KERN_ERR "%s: compare page %u, err %d\n", | 425 | printk(KERN_ERR "%s: compare page %u, err %d\n", |
426 | spi->dev.bus_id, pageaddr, status); | 426 | dev_name(&spi->dev), pageaddr, status); |
427 | remaining = 0; | 427 | remaining = 0; |
428 | status = -EIO; | 428 | status = -EIO; |
429 | break; | 429 | break; |
@@ -779,7 +779,7 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi) | |||
779 | tmp = spi_write_then_read(spi, &code, 1, id, 3); | 779 | tmp = spi_write_then_read(spi, &code, 1, id, 3); |
780 | if (tmp < 0) { | 780 | if (tmp < 0) { |
781 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", | 781 | DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", |
782 | spi->dev.bus_id, tmp); | 782 | dev_name(&spi->dev), tmp); |
783 | return ERR_PTR(tmp); | 783 | return ERR_PTR(tmp); |
784 | } | 784 | } |
785 | if (id[0] != 0x1f) | 785 | if (id[0] != 0x1f) |
@@ -869,7 +869,7 @@ static int __devinit dataflash_probe(struct spi_device *spi) | |||
869 | status = dataflash_status(spi); | 869 | status = dataflash_status(spi); |
870 | if (status <= 0 || status == 0xff) { | 870 | if (status <= 0 || status == 0xff) { |
871 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", | 871 | DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", |
872 | spi->dev.bus_id, status); | 872 | dev_name(&spi->dev), status); |
873 | if (status == 0 || status == 0xff) | 873 | if (status == 0 || status == 0xff) |
874 | status = -ENODEV; | 874 | status = -ENODEV; |
875 | return status; | 875 | return status; |
@@ -905,13 +905,13 @@ static int __devinit dataflash_probe(struct spi_device *spi) | |||
905 | /* obsolete AT45DB1282 not (yet?) supported */ | 905 | /* obsolete AT45DB1282 not (yet?) supported */ |
906 | default: | 906 | default: |
907 | DEBUG(MTD_DEBUG_LEVEL1, "%s: unsupported device (%x)\n", | 907 | DEBUG(MTD_DEBUG_LEVEL1, "%s: unsupported device (%x)\n", |
908 | spi->dev.bus_id, status & 0x3c); | 908 | dev_name(&spi->dev), status & 0x3c); |
909 | status = -ENODEV; | 909 | status = -ENODEV; |
910 | } | 910 | } |
911 | 911 | ||
912 | if (status < 0) | 912 | if (status < 0) |
913 | DEBUG(MTD_DEBUG_LEVEL1, "%s: add_dataflash --> %d\n", | 913 | DEBUG(MTD_DEBUG_LEVEL1, "%s: add_dataflash --> %d\n", |
914 | spi->dev.bus_id, status); | 914 | dev_name(&spi->dev), status); |
915 | 915 | ||
916 | return status; | 916 | return status; |
917 | } | 917 | } |
@@ -921,7 +921,7 @@ static int __devexit dataflash_remove(struct spi_device *spi) | |||
921 | struct dataflash *flash = dev_get_drvdata(&spi->dev); | 921 | struct dataflash *flash = dev_get_drvdata(&spi->dev); |
922 | int status; | 922 | int status; |
923 | 923 | ||
924 | DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", spi->dev.bus_id); | 924 | DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", dev_name(&spi->dev)); |
925 | 925 | ||
926 | if (mtd_has_partitions() && flash->partitioned) | 926 | if (mtd_has_partitions() && flash->partitioned) |
927 | status = del_mtd_partitions(&flash->mtd); | 927 | status = del_mtd_partitions(&flash->mtd); |