mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
power: reset: at91-poweroff: do not procede if at91_shdwc is allocated
[ Upstream commit 9f1e44774b ]
There should be only one instance of struct shdwc in the system. This is
referenced through at91_shdwc. Return in probe if at91_shdwc is already
allocated.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c83c60771e
commit
c8dc500fac
@@ -246,6 +246,9 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
|
||||
if (!pdev->dev.of_node)
|
||||
return -ENODEV;
|
||||
|
||||
if (at91_shdwc)
|
||||
return -EBUSY;
|
||||
|
||||
at91_shdwc = devm_kzalloc(&pdev->dev, sizeof(*at91_shdwc), GFP_KERNEL);
|
||||
if (!at91_shdwc)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user