Skip to content

Commit 93daf13

Browse files
author
Ulf Hansson
committed
mmc: Merge branch fixes into next
Merge the mmc fixes for v6.18-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.19. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2 parents cc7bcbb + 739f04f commit 93daf13

2 files changed

Lines changed: 20 additions & 40 deletions

File tree

drivers/mmc/host/dw_mmc-rockchip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct dw_mci_rockchip_priv_data {
4242
*/
4343
static int rockchip_mmc_get_internal_phase(struct dw_mci *host, bool sample)
4444
{
45-
unsigned long rate = clk_get_rate(host->ciu_clk);
45+
unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
4646
u32 raw_value;
4747
u16 degrees;
4848
u32 delay_num = 0;
@@ -85,7 +85,7 @@ static int rockchip_mmc_get_phase(struct dw_mci *host, bool sample)
8585

8686
static int rockchip_mmc_set_internal_phase(struct dw_mci *host, bool sample, int degrees)
8787
{
88-
unsigned long rate = clk_get_rate(host->ciu_clk);
88+
unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
8989
u8 nineties, remainder;
9090
u8 delay_num;
9191
u32 raw_value;

drivers/mmc/host/pxamci.c

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,9 @@ static int pxamci_probe(struct platform_device *pdev)
652652
host->clkrt = CLKRT_OFF;
653653

654654
host->clk = devm_clk_get(dev, NULL);
655-
if (IS_ERR(host->clk)) {
656-
host->clk = NULL;
657-
return PTR_ERR(host->clk);
658-
}
655+
if (IS_ERR(host->clk))
656+
return dev_err_probe(dev, PTR_ERR(host->clk),
657+
"Failed to acquire clock\n");
659658

660659
host->clkrate = clk_get_rate(host->clk);
661660

@@ -703,46 +702,37 @@ static int pxamci_probe(struct platform_device *pdev)
703702

704703
platform_set_drvdata(pdev, mmc);
705704

706-
host->dma_chan_rx = dma_request_chan(dev, "rx");
707-
if (IS_ERR(host->dma_chan_rx)) {
708-
host->dma_chan_rx = NULL;
705+
host->dma_chan_rx = devm_dma_request_chan(dev, "rx");
706+
if (IS_ERR(host->dma_chan_rx))
709707
return dev_err_probe(dev, PTR_ERR(host->dma_chan_rx),
710708
"unable to request rx dma channel\n");
711-
}
712709

713-
host->dma_chan_tx = dma_request_chan(dev, "tx");
714-
if (IS_ERR(host->dma_chan_tx)) {
715-
dev_err(dev, "unable to request tx dma channel\n");
716-
ret = PTR_ERR(host->dma_chan_tx);
717-
host->dma_chan_tx = NULL;
718-
goto out;
719-
}
710+
711+
host->dma_chan_tx = devm_dma_request_chan(dev, "tx");
712+
if (IS_ERR(host->dma_chan_tx))
713+
return dev_err_probe(dev, PTR_ERR(host->dma_chan_tx),
714+
"unable to request tx dma channel\n");
720715

721716
if (host->pdata) {
722717
host->detect_delay_ms = host->pdata->detect_delay_ms;
723718

724719
host->power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
725-
if (IS_ERR(host->power)) {
726-
ret = PTR_ERR(host->power);
727-
dev_err(dev, "Failed requesting gpio_power\n");
728-
goto out;
729-
}
720+
if (IS_ERR(host->power))
721+
return dev_err_probe(dev, PTR_ERR(host->power),
722+
"Failed requesting gpio_power\n");
730723

731724
/* FIXME: should we pass detection delay to debounce? */
732725
ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
733-
if (ret && ret != -ENOENT) {
734-
dev_err(dev, "Failed requesting gpio_cd\n");
735-
goto out;
736-
}
726+
if (ret && ret != -ENOENT)
727+
return dev_err_probe(dev, ret, "Failed requesting gpio_cd\n");
737728

738729
if (!host->pdata->gpio_card_ro_invert)
739730
mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
740731

741732
ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0);
742-
if (ret && ret != -ENOENT) {
743-
dev_err(dev, "Failed requesting gpio_ro\n");
744-
goto out;
745-
}
733+
if (ret && ret != -ENOENT)
734+
return dev_err_probe(dev, ret, "Failed requesting gpio_ro\n");
735+
746736
if (!ret)
747737
host->use_ro_gpio = true;
748738

@@ -759,16 +749,8 @@ static int pxamci_probe(struct platform_device *pdev)
759749
if (ret) {
760750
if (host->pdata && host->pdata->exit)
761751
host->pdata->exit(dev, mmc);
762-
goto out;
763752
}
764753

765-
return 0;
766-
767-
out:
768-
if (host->dma_chan_rx)
769-
dma_release_channel(host->dma_chan_rx);
770-
if (host->dma_chan_tx)
771-
dma_release_channel(host->dma_chan_tx);
772754
return ret;
773755
}
774756

@@ -791,8 +773,6 @@ static void pxamci_remove(struct platform_device *pdev)
791773

792774
dmaengine_terminate_all(host->dma_chan_rx);
793775
dmaengine_terminate_all(host->dma_chan_tx);
794-
dma_release_channel(host->dma_chan_rx);
795-
dma_release_channel(host->dma_chan_tx);
796776
}
797777
}
798778

0 commit comments

Comments
 (0)