static int ar934x_nfc_probe(struct platform_device *pdev)
{
struct ar934x_nfc *nfc;
- struct resource *res;
struct mtd_info *mtd;
struct nand_chip *nand;
int ret;
pdev->dev.dma_mask = &ar934x_nfc_dma_mask;
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pdev->dev, "failed to get I/O memory\n");
- return -EINVAL;
- }
-
nfc = devm_kzalloc(&pdev->dev, sizeof(struct ar934x_nfc), GFP_KERNEL);
if (!nfc) {
dev_err(&pdev->dev, "failed to allocate driver data\n");
return -ENOMEM;
}
- nfc->base = devm_ioremap_resource(&pdev->dev, res);
+ nfc->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(nfc->base)) {
dev_err(&pdev->dev, "failed to remap I/O memory\n");
return PTR_ERR(nfc->base);
+obj-$(CONFIG_QCOM_TCSR) += qcom_tcsr.o
--- /dev/null
+++ b/drivers/soc/qcom/qcom_tcsr.c
-@@ -0,0 +1,98 @@
+@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, The Linux foundation. All rights reserved.
+ *
+
+static int tcsr_probe(struct platform_device *pdev)
+{
-+ struct resource *res;
+ const struct device_node *node = pdev->dev.of_node;
+ void __iomem *base;
+ u32 val;
+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ base = devm_ioremap_resource(&pdev->dev, res);
++ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
depends on ARCH_QCOM || COMPILE_TEST
--- /dev/null
+++ b/drivers/soc/qcom/qcom_tcsr.c
-@@ -0,0 +1,64 @@
+@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, The Linux foundation. All rights reserved.
+ *
+
+static int tcsr_probe(struct platform_device *pdev)
+{
-+ struct resource *res;
+ const struct device_node *node = pdev->dev.of_node;
+ void __iomem *base;
+ u32 val;
+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ base = devm_ioremap_resource(&pdev->dev, res);
++ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
obj-$(CONFIG_I2C_MESON) += i2c-meson.o
--- /dev/null
+++ b/drivers/i2c/busses/i2c-lantiq.c
-@@ -0,0 +1,747 @@
+@@ -0,0 +1,746 @@
+
+/*
+ * Lantiq I2C bus adapter
+ struct device_node *node = pdev->dev.of_node;
+ struct ltq_i2c *priv;
+ struct i2c_adapter *adap;
-+ struct resource *mmres, irqres[4];
++ struct resource irqres[4];
+ int ret = 0;
+
+ dev_dbg(&pdev->dev, "probing\n");
+
-+ mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ ret = of_irq_to_resource_table(node, irqres, 4);
-+ if (!mmres || (ret != 4)) {
++ if (ret != 4) {
+ dev_err(&pdev->dev, "no resources\n");
+ return -ENODEV;
+ }
+ init_completion(&priv->cmd_complete);
+ mutex_init(&priv->mutex);
+
-+ priv->membase = devm_ioremap_resource(&pdev->dev, mmres);
++ priv->membase = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(priv->membase))
+ return PTR_ERR(priv->membase);
+
static int msdc_drv_probe(struct platform_device *pdev)
{
- struct resource *res;
__iomem void *base;
struct mmc_host *mmc;
struct msdc_host *host;
if (!mmc)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(&pdev->dev, res);
+ base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) {
ret = PTR_ERR(base);
goto host_free;
if (IS_ERR(nfc->nfi_regs))
return PTR_ERR(nfc->nfi_regs);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ecc");
- nfc->ecc_regs = devm_ioremap_resource(dev, res);
+ nfc->ecc_regs = devm_platform_ioremap_resource_byname(pdev, "ecc");
if (IS_ERR(nfc->ecc_regs))
return PTR_ERR(nfc->ecc_regs);
static int esw_probe(struct platform_device *pdev)
{
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
struct device_node *np = pdev->dev.of_node;
const __be32 *port_map, *port_disable, *reg_init;
struct rt305x_esw *esw;
esw->dev = &pdev->dev;
esw->irq = irq_of_parse_and_map(np, 0);
- esw->base = devm_ioremap_resource(&pdev->dev, res);
+ esw->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(esw->base))
return PTR_ERR(esw->base);
static int mt7620_gsw_probe(struct platform_device *pdev)
{
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
struct mt7620_gsw *gsw;
gsw = devm_kzalloc(&pdev->dev, sizeof(struct mt7620_gsw), GFP_KERNEL);
if (!gsw)
return -ENOMEM;
- gsw->base = devm_ioremap_resource(&pdev->dev, res);
+ gsw->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(gsw->base))
return PTR_ERR(gsw->base);
+#endif /* _EIP93_DES_H_ */
--- /dev/null
+++ b/drivers/crypto/mtk-eip93/eip93-main.c
-@@ -0,0 +1,467 @@
+@@ -0,0 +1,465 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 - 2021
+{
+ struct device *dev = &pdev->dev;
+ struct mtk_device *mtk;
-+ struct resource *res;
+ int err;
+
+ mtk = devm_kzalloc(dev, sizeof(*mtk), GFP_KERNEL);
+ mtk->dev = dev;
+ platform_set_drvdata(pdev, mtk);
+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ mtk->base = devm_ioremap_resource(&pdev->dev, res);
++ mtk->base = devm_platform_ioremap_resource(pdev, 0);
+
+ if (IS_ERR(mtk->base))
+ return PTR_ERR(mtk->base);
static int rtl9300_i2c_probe(struct platform_device *pdev)
{
- struct resource *res;
struct rtl9300_i2c *i2c;
struct i2c_adapter *adap;
struct i2c_drv_data *drv_data;
return -EINVAL;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
drv_data = (struct i2c_drv_data *) device_get_match_data(&pdev->dev);
i2c = devm_kzalloc(&pdev->dev, sizeof(struct rtl9300_i2c), GFP_KERNEL);
if (!i2c)
return -ENOMEM;
- i2c->base = devm_ioremap_resource(&pdev->dev, res);
+ i2c->base = devm_platform_ioremap_resource(pdev, 0);
i2c->mst2_offset = drv_data->mst2_offset;
if (IS_ERR(i2c->base))
return PTR_ERR(i2c->base);