diff options
Diffstat (limited to 'drivers/mtd/nand/gpio.c')
-rw-r--r-- | drivers/mtd/nand/gpio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c index 8dfdbb63e096..8e6148aa4539 100644 --- a/drivers/mtd/nand/gpio.c +++ b/drivers/mtd/nand/gpio.c | |||
@@ -132,13 +132,17 @@ static int gpio_nand_get_config_of(const struct device *dev, | |||
132 | 132 | ||
133 | static struct resource *gpio_nand_get_io_sync_of(struct platform_device *pdev) | 133 | static struct resource *gpio_nand_get_io_sync_of(struct platform_device *pdev) |
134 | { | 134 | { |
135 | struct resource *r = devm_kzalloc(&pdev->dev, sizeof(*r), GFP_KERNEL); | 135 | struct resource *r; |
136 | u64 addr; | 136 | u64 addr; |
137 | 137 | ||
138 | if (!r || of_property_read_u64(pdev->dev.of_node, | 138 | if (of_property_read_u64(pdev->dev.of_node, |
139 | "gpio-control-nand,io-sync-reg", &addr)) | 139 | "gpio-control-nand,io-sync-reg", &addr)) |
140 | return NULL; | 140 | return NULL; |
141 | 141 | ||
142 | r = devm_kzalloc(&pdev->dev, sizeof(*r), GFP_KERNEL); | ||
143 | if (!r) | ||
144 | return NULL; | ||
145 | |||
142 | r->start = addr; | 146 | r->start = addr; |
143 | r->end = r->start + 0x3; | 147 | r->end = r->start + 0x3; |
144 | r->flags = IORESOURCE_MEM; | 148 | r->flags = IORESOURCE_MEM; |