Skip to content

Commit d07ebea

Browse files
andy-shevstorulf
authored andcommitted
mmc: atmel-mci: Replace platform device pointer by generic one
There no need to keep a pointer to a platform device as it's not used outside of ->probe() and ->remove() callbacks. Replace platform device pointer by generic one in host structure. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 5c30bd2 commit d07ebea

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

drivers/mmc/host/atmel-mci.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ struct atmel_mci_dma {
296296
* rate and timeout calculations.
297297
* @mapbase: Physical address of the MMIO registers.
298298
* @mck: The peripheral bus clock hooked up to the MMC controller.
299-
* @pdev: Platform device associated with the MMC controller.
299+
* @dev: Device associated with the MMC controller.
300300
* @slot: Slots sharing this MMC controller.
301301
* @caps: MCI capabilities depending on MCI version.
302302
* @prepare_data: function to setup MCI before data transfer which
@@ -373,7 +373,7 @@ struct atmel_mci {
373373
unsigned long bus_hz;
374374
unsigned long mapbase;
375375
struct clk *mck;
376-
struct platform_device *pdev;
376+
struct device *dev;
377377

378378
struct atmel_mci_slot *slot[ATMCI_MAX_NR_SLOTS];
379379

@@ -526,7 +526,7 @@ static void atmci_show_status_reg(struct seq_file *s,
526526
static int atmci_regs_show(struct seq_file *s, void *v)
527527
{
528528
struct atmel_mci *host = s->private;
529-
struct device *dev = &host->pdev->dev;
529+
struct device *dev = host->dev;
530530
u32 *buf;
531531
int ret = 0;
532532

@@ -726,7 +726,7 @@ static inline unsigned int atmci_convert_chksize(struct atmel_mci *host,
726726
static void atmci_timeout_timer(struct timer_list *t)
727727
{
728728
struct atmel_mci *host = from_timer(host, t, timer);
729-
struct device *dev = &host->pdev->dev;
729+
struct device *dev = host->dev;
730730

731731
dev_dbg(dev, "software timeout\n");
732732

@@ -846,7 +846,7 @@ static u32 atmci_prepare_command(struct mmc_host *mmc,
846846
static void atmci_send_command(struct atmel_mci *host,
847847
struct mmc_command *cmd, u32 cmd_flags)
848848
{
849-
struct device *dev = &host->pdev->dev;
849+
struct device *dev = host->dev;
850850
unsigned int timeout_ms = cmd->busy_timeout ? cmd->busy_timeout :
851851
ATMCI_CMD_TIMEOUT_MS;
852852

@@ -863,7 +863,7 @@ static void atmci_send_command(struct atmel_mci *host,
863863

864864
static void atmci_send_stop_cmd(struct atmel_mci *host, struct mmc_data *data)
865865
{
866-
struct device *dev = &host->pdev->dev;
866+
struct device *dev = host->dev;
867867

868868
dev_dbg(dev, "send stop command\n");
869869
atmci_send_command(host, data->stop, host->stop_cmdr);
@@ -937,8 +937,8 @@ static void atmci_pdc_set_both_buf(struct atmel_mci *host, int dir)
937937
*/
938938
static void atmci_pdc_cleanup(struct atmel_mci *host)
939939
{
940-
struct device *dev = &host->pdev->dev;
941940
struct mmc_data *data = host->data;
941+
struct device *dev = host->dev;
942942

943943
if (data)
944944
dma_unmap_sg(dev, data->sg, data->sg_len, mmc_get_dma_dir(data));
@@ -951,7 +951,7 @@ static void atmci_pdc_cleanup(struct atmel_mci *host)
951951
*/
952952
static void atmci_pdc_complete(struct atmel_mci *host)
953953
{
954-
struct device *dev = &host->pdev->dev;
954+
struct device *dev = host->dev;
955955
int transfer_size = host->data->blocks * host->data->blksz;
956956
int i;
957957

@@ -989,8 +989,8 @@ static void atmci_dma_cleanup(struct atmel_mci *host)
989989
static void atmci_dma_complete(void *arg)
990990
{
991991
struct atmel_mci *host = arg;
992-
struct device *dev = &host->pdev->dev;
993992
struct mmc_data *data = host->data;
993+
struct device *dev = host->dev;
994994

995995
dev_vdbg(dev, "DMA complete\n");
996996

@@ -1079,7 +1079,7 @@ static u32 atmci_prepare_data(struct atmel_mci *host, struct mmc_data *data)
10791079
static u32
10801080
atmci_prepare_data_pdc(struct atmel_mci *host, struct mmc_data *data)
10811081
{
1082-
struct device *dev = &host->pdev->dev;
1082+
struct device *dev = host->dev;
10831083
u32 iflags, tmp;
10841084
int i;
10851085

@@ -1231,7 +1231,7 @@ atmci_submit_data_dma(struct atmel_mci *host, struct mmc_data *data)
12311231

12321232
static void atmci_stop_transfer(struct atmel_mci *host)
12331233
{
1234-
struct device *dev = &host->pdev->dev;
1234+
struct device *dev = host->dev;
12351235

12361236
dev_dbg(dev, "(%s) set pending xfer complete\n", __func__);
12371237
atmci_set_pending(host, EVENT_XFER_COMPLETE);
@@ -1249,7 +1249,7 @@ static void atmci_stop_transfer_pdc(struct atmel_mci *host)
12491249
static void atmci_stop_transfer_dma(struct atmel_mci *host)
12501250
{
12511251
struct dma_chan *chan = host->data_chan;
1252-
struct device *dev = &host->pdev->dev;
1252+
struct device *dev = host->dev;
12531253

12541254
if (chan) {
12551255
dmaengine_terminate_all(chan);
@@ -1269,7 +1269,7 @@ static void atmci_stop_transfer_dma(struct atmel_mci *host)
12691269
static void atmci_start_request(struct atmel_mci *host,
12701270
struct atmel_mci_slot *slot)
12711271
{
1272-
struct device *dev = &host->pdev->dev;
1272+
struct device *dev = host->dev;
12731273
struct mmc_request *mrq;
12741274
struct mmc_command *cmd;
12751275
struct mmc_data *data;
@@ -1364,7 +1364,7 @@ static void atmci_start_request(struct atmel_mci *host,
13641364
static void atmci_queue_request(struct atmel_mci *host,
13651365
struct atmel_mci_slot *slot, struct mmc_request *mrq)
13661366
{
1367-
struct device *dev = &host->pdev->dev;
1367+
struct device *dev = host->dev;
13681368

13691369
dev_vdbg(&slot->mmc->class_dev, "queue request: state=%d\n",
13701370
host->state);
@@ -1385,7 +1385,7 @@ static void atmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
13851385
{
13861386
struct atmel_mci_slot *slot = mmc_priv(mmc);
13871387
struct atmel_mci *host = slot->host;
1388-
struct device *dev = &host->pdev->dev;
1388+
struct device *dev = host->dev;
13891389
struct mmc_data *data;
13901390

13911391
WARN_ON(slot->mrq);
@@ -1599,7 +1599,7 @@ static void atmci_request_end(struct atmel_mci *host, struct mmc_request *mrq)
15991599
{
16001600
struct atmel_mci_slot *slot = NULL;
16011601
struct mmc_host *prev_mmc = host->cur_slot->mmc;
1602-
struct device *dev = &host->pdev->dev;
1602+
struct device *dev = host->dev;
16031603

16041604
WARN_ON(host->cmd || host->data);
16051605

@@ -1760,9 +1760,9 @@ static void atmci_detect_change(struct timer_list *t)
17601760
static void atmci_tasklet_func(struct tasklet_struct *t)
17611761
{
17621762
struct atmel_mci *host = from_tasklet(host, t, tasklet);
1763-
struct device *dev = &host->pdev->dev;
17641763
struct mmc_request *mrq = host->mrq;
17651764
struct mmc_data *data = host->data;
1765+
struct device *dev = host->dev;
17661766
enum atmel_mci_state state = host->state;
17671767
enum atmel_mci_state prev_state;
17681768
u32 status;
@@ -2108,7 +2108,7 @@ static void atmci_sdio_interrupt(struct atmel_mci *host, u32 status)
21082108
static irqreturn_t atmci_interrupt(int irq, void *dev_id)
21092109
{
21102110
struct atmel_mci *host = dev_id;
2111-
struct device *dev = &host->pdev->dev;
2111+
struct device *dev = host->dev;
21122112
u32 status, mask, pending;
21132113
unsigned int pass_count = 0;
21142114

@@ -2253,7 +2253,7 @@ static int atmci_init_slot(struct atmel_mci *host,
22532253
struct mci_slot_pdata *slot_data, unsigned int id,
22542254
u32 sdc_reg, u32 sdio_irq)
22552255
{
2256-
struct device *dev = &host->pdev->dev;
2256+
struct device *dev = host->dev;
22572257
struct mmc_host *mmc;
22582258
struct atmel_mci_slot *slot;
22592259
int ret;
@@ -2377,7 +2377,7 @@ static void atmci_cleanup_slot(struct atmel_mci_slot *slot,
23772377

23782378
static int atmci_configure_dma(struct atmel_mci *host)
23792379
{
2380-
struct device *dev = &host->pdev->dev;
2380+
struct device *dev = host->dev;
23812381

23822382
host->dma.chan = dma_request_chan(dev, "rxtx");
23832383
if (IS_ERR(host->dma.chan))
@@ -2403,7 +2403,7 @@ static int atmci_configure_dma(struct atmel_mci *host)
24032403
*/
24042404
static void atmci_get_cap(struct atmel_mci *host)
24052405
{
2406-
struct device *dev = &host->pdev->dev;
2406+
struct device *dev = host->dev;
24072407
unsigned int version;
24082408

24092409
version = atmci_get_version(host);
@@ -2481,7 +2481,7 @@ static int atmci_probe(struct platform_device *pdev)
24812481
if (!host)
24822482
return -ENOMEM;
24832483

2484-
host->pdev = pdev;
2484+
host->dev = dev;
24852485
spin_lock_init(&host->lock);
24862486
INIT_LIST_HEAD(&host->queue);
24872487

0 commit comments

Comments
 (0)