mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
mfd: vexpress-sysreg: Check the return value of devm_gpiochip_add_data()
[ Upstream commit 1efbee6852f1ff698a9981bd731308dd027189fb ] Commit974cc7b934("mfd: vexpress: Define the device as MFD cells") removed the return value check from the call to gpiochip_add_data() (or rather gpiochip_add() back then and later converted to devres) with no explanation. This function however can still fail, so check the return value and bail-out if it does. Cc: stable@vger.kernel.org Fixes:974cc7b934("mfd: vexpress: Define the device as MFD cells") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250811-gpio-mmio-mfd-conv-v1-1-68c5c958cf80@linaro.org Signed-off-by: Lee Jones <lee@kernel.org> [ Use non-devm variants ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
14496175b2
commit
38bdc302c5
1 changed files with 5 additions and 1 deletions
|
|
@ -160,6 +160,7 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
|
|||
struct gpio_chip *mmc_gpio_chip;
|
||||
int master;
|
||||
u32 dt_hbi;
|
||||
int ret;
|
||||
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!mem)
|
||||
|
|
@ -195,7 +196,10 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
|
|||
bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI,
|
||||
NULL, NULL, NULL, NULL, 0);
|
||||
mmc_gpio_chip->ngpio = 2;
|
||||
gpiochip_add_data(mmc_gpio_chip, NULL);
|
||||
|
||||
ret = gpiochip_add_data(mmc_gpio_chip, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
|
||||
vexpress_sysreg_cells,
|
||||
|
|
|
|||
Loading…
Reference in a new issue