aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memstick
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-03-03 18:13:36 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-19 22:10:29 -0400
commitc4c66cf1787d408066fbfc69209185701f5df15f (patch)
tree989a6f49ae760b0015b489ca678bbe8baf2c3c85 /drivers/memstick
parent2b3a302a09735276e13421db56c20045a48eb06d (diff)
memstick: convert struct class_device to struct device
struct class_device is going away, struct device should be used instead. Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Alex Dubov <oakad@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/memstick')
-rw-r--r--drivers/memstick/core/memstick.c33
-rw-r--r--drivers/memstick/core/mspro_block.c4
-rw-r--r--drivers/memstick/host/jmb38x_ms.c16
3 files changed, 26 insertions, 27 deletions
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index 946e3d3506ac..61b98c333cb0 100644
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -177,16 +177,16 @@ static struct bus_type memstick_bus_type = {
177 .resume = memstick_device_resume 177 .resume = memstick_device_resume
178}; 178};
179 179
180static void memstick_free(struct class_device *cdev) 180static void memstick_free(struct device *dev)
181{ 181{
182 struct memstick_host *host = container_of(cdev, struct memstick_host, 182 struct memstick_host *host = container_of(dev, struct memstick_host,
183 cdev); 183 dev);
184 kfree(host); 184 kfree(host);
185} 185}
186 186
187static struct class memstick_host_class = { 187static struct class memstick_host_class = {
188 .name = "memstick_host", 188 .name = "memstick_host",
189 .release = memstick_free 189 .dev_release = memstick_free
190}; 190};
191 191
192static void memstick_free_card(struct device *dev) 192static void memstick_free_card(struct device *dev)
@@ -383,8 +383,8 @@ static struct memstick_dev *memstick_alloc_card(struct memstick_host *host)
383 if (card) { 383 if (card) {
384 card->host = host; 384 card->host = host;
385 snprintf(card->dev.bus_id, sizeof(card->dev.bus_id), 385 snprintf(card->dev.bus_id, sizeof(card->dev.bus_id),
386 "%s", host->cdev.class_id); 386 "%s", host->dev.bus_id);
387 card->dev.parent = host->cdev.dev; 387 card->dev.parent = &host->dev;
388 card->dev.bus = &memstick_bus_type; 388 card->dev.bus = &memstick_bus_type;
389 card->dev.release = memstick_free_card; 389 card->dev.release = memstick_free_card;
390 card->check = memstick_dummy_check; 390 card->check = memstick_dummy_check;
@@ -427,7 +427,7 @@ static void memstick_check(struct work_struct *work)
427 media_checker); 427 media_checker);
428 struct memstick_dev *card; 428 struct memstick_dev *card;
429 429
430 dev_dbg(host->cdev.dev, "memstick_check started\n"); 430 dev_dbg(&host->dev, "memstick_check started\n");
431 mutex_lock(&host->lock); 431 mutex_lock(&host->lock);
432 if (!host->card) 432 if (!host->card)
433 memstick_power_on(host); 433 memstick_power_on(host);
@@ -440,7 +440,7 @@ static void memstick_check(struct work_struct *work)
440 host->card = NULL; 440 host->card = NULL;
441 } 441 }
442 } else { 442 } else {
443 dev_dbg(host->cdev.dev, "new card %02x, %02x, %02x\n", 443 dev_dbg(&host->dev, "new card %02x, %02x, %02x\n",
444 card->id.type, card->id.category, card->id.class); 444 card->id.type, card->id.category, card->id.class);
445 if (host->card) { 445 if (host->card) {
446 if (memstick_set_rw_addr(host->card) 446 if (memstick_set_rw_addr(host->card)
@@ -465,7 +465,7 @@ static void memstick_check(struct work_struct *work)
465 host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF); 465 host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF);
466 466
467 mutex_unlock(&host->lock); 467 mutex_unlock(&host->lock);
468 dev_dbg(host->cdev.dev, "memstick_check finished\n"); 468 dev_dbg(&host->dev, "memstick_check finished\n");
469} 469}
470 470
471/** 471/**
@@ -482,9 +482,9 @@ struct memstick_host *memstick_alloc_host(unsigned int extra,
482 if (host) { 482 if (host) {
483 mutex_init(&host->lock); 483 mutex_init(&host->lock);
484 INIT_WORK(&host->media_checker, memstick_check); 484 INIT_WORK(&host->media_checker, memstick_check);
485 host->cdev.class = &memstick_host_class; 485 host->dev.class = &memstick_host_class;
486 host->cdev.dev = dev; 486 host->dev.parent = dev;
487 class_device_initialize(&host->cdev); 487 device_initialize(&host->dev);
488 } 488 }
489 return host; 489 return host;
490} 490}
@@ -507,10 +507,9 @@ int memstick_add_host(struct memstick_host *host)
507 if (rc) 507 if (rc)
508 return rc; 508 return rc;
509 509
510 snprintf(host->cdev.class_id, BUS_ID_SIZE, 510 snprintf(host->dev.bus_id, BUS_ID_SIZE, "memstick%u", host->id);
511 "memstick%u", host->id);
512 511
513 rc = class_device_add(&host->cdev); 512 rc = device_add(&host->dev);
514 if (rc) { 513 if (rc) {
515 spin_lock(&memstick_host_lock); 514 spin_lock(&memstick_host_lock);
516 idr_remove(&memstick_host_idr, host->id); 515 idr_remove(&memstick_host_idr, host->id);
@@ -541,7 +540,7 @@ void memstick_remove_host(struct memstick_host *host)
541 spin_lock(&memstick_host_lock); 540 spin_lock(&memstick_host_lock);
542 idr_remove(&memstick_host_idr, host->id); 541 idr_remove(&memstick_host_idr, host->id);
543 spin_unlock(&memstick_host_lock); 542 spin_unlock(&memstick_host_lock);
544 class_device_del(&host->cdev); 543 device_del(&host->dev);
545} 544}
546EXPORT_SYMBOL(memstick_remove_host); 545EXPORT_SYMBOL(memstick_remove_host);
547 546
@@ -552,7 +551,7 @@ EXPORT_SYMBOL(memstick_remove_host);
552void memstick_free_host(struct memstick_host *host) 551void memstick_free_host(struct memstick_host *host)
553{ 552{
554 mutex_destroy(&host->lock); 553 mutex_destroy(&host->lock);
555 class_device_put(&host->cdev); 554 put_device(&host->dev);
556} 555}
557EXPORT_SYMBOL(memstick_free_host); 556EXPORT_SYMBOL(memstick_free_host);
558 557
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 557dbbba5cb2..477d0fb6e588 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -1127,8 +1127,8 @@ static int mspro_block_init_disk(struct memstick_dev *card)
1127 u64 limit = BLK_BOUNCE_HIGH; 1127 u64 limit = BLK_BOUNCE_HIGH;
1128 unsigned long capacity; 1128 unsigned long capacity;
1129 1129
1130 if (host->cdev.dev->dma_mask && *(host->cdev.dev->dma_mask)) 1130 if (host->dev.dma_mask && *(host->dev.dma_mask))
1131 limit = *(host->cdev.dev->dma_mask); 1131 limit = *(host->dev.dma_mask);
1132 1132
1133 for (rc = 0; msb->attr_group.attrs[rc]; ++rc) { 1133 for (rc = 0; msb->attr_group.attrs[rc]; ++rc) {
1134 s_attr = mspro_from_sysfs_attr(msb->attr_group.attrs[rc]); 1134 s_attr = mspro_from_sysfs_attr(msb->attr_group.attrs[rc]);
diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
index 8770a5fac3b6..a054668eda16 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -361,15 +361,15 @@ static int jmb38x_ms_issue_cmd(struct memstick_host *msh)
361 unsigned int data_len, cmd, t_val; 361 unsigned int data_len, cmd, t_val;
362 362
363 if (!(STATUS_HAS_MEDIA & readl(host->addr + STATUS))) { 363 if (!(STATUS_HAS_MEDIA & readl(host->addr + STATUS))) {
364 dev_dbg(msh->cdev.dev, "no media status\n"); 364 dev_dbg(&msh->dev, "no media status\n");
365 host->req->error = -ETIME; 365 host->req->error = -ETIME;
366 return host->req->error; 366 return host->req->error;
367 } 367 }
368 368
369 dev_dbg(msh->cdev.dev, "control %08x\n", 369 dev_dbg(&msh->dev, "control %08x\n",
370 readl(host->addr + HOST_CONTROL)); 370 readl(host->addr + HOST_CONTROL));
371 dev_dbg(msh->cdev.dev, "status %08x\n", readl(host->addr + INT_STATUS)); 371 dev_dbg(&msh->dev, "status %08x\n", readl(host->addr + INT_STATUS));
372 dev_dbg(msh->cdev.dev, "hstatus %08x\n", readl(host->addr + STATUS)); 372 dev_dbg(&msh->dev, "hstatus %08x\n", readl(host->addr + STATUS));
373 373
374 host->cmd_flags = 0; 374 host->cmd_flags = 0;
375 host->block_pos = 0; 375 host->block_pos = 0;
@@ -448,7 +448,7 @@ static int jmb38x_ms_issue_cmd(struct memstick_host *msh)
448 host->req->error = 0; 448 host->req->error = 0;
449 449
450 writel(cmd, host->addr + TPC); 450 writel(cmd, host->addr + TPC);
451 dev_dbg(msh->cdev.dev, "executing TPC %08x, len %x\n", cmd, data_len); 451 dev_dbg(&msh->dev, "executing TPC %08x, len %x\n", cmd, data_len);
452 452
453 return 0; 453 return 0;
454} 454}
@@ -461,11 +461,11 @@ static void jmb38x_ms_complete_cmd(struct memstick_host *msh, int last)
461 461
462 del_timer(&host->timer); 462 del_timer(&host->timer);
463 463
464 dev_dbg(msh->cdev.dev, "c control %08x\n", 464 dev_dbg(&msh->dev, "c control %08x\n",
465 readl(host->addr + HOST_CONTROL)); 465 readl(host->addr + HOST_CONTROL));
466 dev_dbg(msh->cdev.dev, "c status %08x\n", 466 dev_dbg(&msh->dev, "c status %08x\n",
467 readl(host->addr + INT_STATUS)); 467 readl(host->addr + INT_STATUS));
468 dev_dbg(msh->cdev.dev, "c hstatus %08x\n", readl(host->addr + STATUS)); 468 dev_dbg(&msh->dev, "c hstatus %08x\n", readl(host->addr + STATUS));
469 469
470 host->req->int_reg = readl(host->addr + STATUS) & 0xff; 470 host->req->int_reg = readl(host->addr + STATUS) & 0xff;
471 471