mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 12:14:10 +08:00
gpio: mvebu: use generic device properties
OF-specific routines should not be used unless necessary. Generic device properties are preferred so switch to using them in the driver code. Link: https://lore.kernel.org/r/20240930091111.32010-2-brgl@bgdev.pl Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
956ee0c5c9
commit
ddfdfe76ca
@ -794,8 +794,8 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
|
||||
u32 set;
|
||||
|
||||
if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
|
||||
int ret = of_property_read_u32(dev->of_node,
|
||||
"marvell,pwm-offset", &offset);
|
||||
int ret = device_property_read_u32(dev, "marvell,pwm-offset",
|
||||
&offset);
|
||||
if (ret < 0)
|
||||
return 0;
|
||||
} else {
|
||||
@ -1106,7 +1106,7 @@ static int mvebu_gpio_probe_syscon(struct platform_device *pdev,
|
||||
if (IS_ERR(mvchip->regs))
|
||||
return PTR_ERR(mvchip->regs);
|
||||
|
||||
if (of_property_read_u32(pdev->dev.of_node, "offset", &mvchip->offset))
|
||||
if (device_property_read_u32(&pdev->dev, "offset", &mvchip->offset))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
@ -1147,7 +1147,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, mvchip);
|
||||
|
||||
if (of_property_read_u32(pdev->dev.of_node, "ngpios", &ngpios)) {
|
||||
if (device_property_read_u32(&pdev->dev, "ngpios", &ngpios)) {
|
||||
dev_err(&pdev->dev, "Missing ngpios OF property\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user