1 From: Florian Fainelli <f.fainelli@gmail.com>
2 Subject: [PATCH v3 3/9] mtd: rawnand: brcmnand: Avoid pdev in brcmnand_init_cs()
3 Date: Fri, 07 Jan 2022 10:46:08 -0800
4 Content-Type: text/plain; charset="utf-8"
6 In preparation for encapsulating more of what the loop calling
7 brcmnand_init_cs() does, avoid using platform_device when it is the
8 device behind platform_device that we are using for printing errors.
10 No functional changes introduced.
12 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
14 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-)
17 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
18 +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
19 @@ -2771,7 +2771,7 @@ static const struct nand_controller_ops
20 static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
22 struct brcmnand_controller *ctrl = host->ctrl;
23 - struct platform_device *pdev = host->pdev;
24 + struct device *dev = ctrl->dev;
26 struct nand_chip *chip;
28 @@ -2779,7 +2779,7 @@ static int brcmnand_init_cs(struct brcmn
30 ret = of_property_read_u32(dn, "reg", &host->cs);
32 - dev_err(&pdev->dev, "can't get chip-select\n");
33 + dev_err(dev, "can't get chip-select\n");
37 @@ -2788,13 +2788,13 @@ static int brcmnand_init_cs(struct brcmn
39 nand_set_flash_node(chip, dn);
40 nand_set_controller_data(chip, host);
41 - mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "brcmnand.%d",
42 + mtd->name = devm_kasprintf(dev, GFP_KERNEL, "brcmnand.%d",
47 mtd->owner = THIS_MODULE;
48 - mtd->dev.parent = &pdev->dev;
49 + mtd->dev.parent = dev;
51 chip->legacy.cmd_ctrl = brcmnand_cmd_ctrl;
52 chip->legacy.cmdfunc = brcmnand_cmdfunc;