aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/mdio-mux-gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/mdio-mux-gpio.c')
-rw-r--r--drivers/net/phy/mdio-mux-gpio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
index 0c9accb1c14f..e91d7d736ae2 100644
--- a/drivers/net/phy/mdio-mux-gpio.c
+++ b/drivers/net/phy/mdio-mux-gpio.c
@@ -53,7 +53,7 @@ static int mdio_mux_gpio_probe(struct platform_device *pdev)
53{ 53{
54 enum of_gpio_flags f; 54 enum of_gpio_flags f;
55 struct mdio_mux_gpio_state *s; 55 struct mdio_mux_gpio_state *s;
56 unsigned int num_gpios; 56 int num_gpios;
57 unsigned int n; 57 unsigned int n;
58 int r; 58 int r;
59 59
@@ -61,7 +61,7 @@ static int mdio_mux_gpio_probe(struct platform_device *pdev)
61 return -ENODEV; 61 return -ENODEV;
62 62
63 num_gpios = of_gpio_count(pdev->dev.of_node); 63 num_gpios = of_gpio_count(pdev->dev.of_node);
64 if (num_gpios == 0 || num_gpios > MDIO_MUX_GPIO_MAX_BITS) 64 if (num_gpios <= 0 || num_gpios > MDIO_MUX_GPIO_MAX_BITS)
65 return -ENODEV; 65 return -ENODEV;
66 66
67 s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL); 67 s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL);