summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/arche-apb-ctrl.c
diff options
context:
space:
mode:
authorViresh Kumar2016-01-11 06:59:10 +0100
committerGreg Kroah-Hartman2016-01-12 00:58:01 +0100
commit7541c1a1c6b0e5531545c400e27b8aee2ba71610 (patch)
tree3bec2da03288bc32bba4151b73f89895ef5c3a10 /drivers/staging/greybus/arche-apb-ctrl.c
parentgreybus: arche-apb: platform data 'apb' is guaranteed to be valid (diff)
downloadkernel-qcow2-linux-7541c1a1c6b0e5531545c400e27b8aee2ba71610.tar.gz
kernel-qcow2-linux-7541c1a1c6b0e5531545c400e27b8aee2ba71610.tar.xz
kernel-qcow2-linux-7541c1a1c6b0e5531545c400e27b8aee2ba71610.zip
greybus: arche-apb: Replace gpio_is_valid() with gpio < 0 checks
There can be no invalid values in the DTS. The actual pin numbers are assigned by gpiolib when the gpio controller is registered. And so a simple 'gpio < 0' is enough instead of gpio_is_valid() which also checks for 'gpio < ARCH_NR_GPIOS'. This will make the usage of of_get_named_gpio() similar with how it is done in arche-platform driver. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/arche-apb-ctrl.c')
-rw-r--r--drivers/staging/greybus/arche-apb-ctrl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
index 3d71093c4697..b06bb3453ca4 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -211,37 +211,37 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev,
struct device_node *np = dev->of_node;
apb->wake_detect_gpio = of_get_named_gpio(np, "wake-detect-gpios", 0);
- if (!gpio_is_valid(apb->wake_detect_gpio)) {
+ if (apb->wake_detect_gpio < 0) {
dev_err(dev, "failed to get wake detect gpio\n");
return apb->wake_detect_gpio;
}
apb->resetn_gpio = of_get_named_gpio(np, "reset-gpios", 0);
- if (!gpio_is_valid(apb->resetn_gpio)) {
+ if (apb->resetn_gpio < 0) {
dev_err(dev, "failed to get reset gpio\n");
return apb->resetn_gpio;
}
apb->boot_ret_gpio = of_get_named_gpio(np, "boot-ret-gpios", 0);
- if (!gpio_is_valid(apb->boot_ret_gpio)) {
+ if (apb->boot_ret_gpio < 0) {
dev_err(dev, "failed to get boot retention gpio\n");
return apb->boot_ret_gpio;
}
/* It's not mandatory to support power management interface */
apb->pwroff_gpio = of_get_named_gpio(np, "pwr-off-gpios", 0);
- if (!gpio_is_valid(apb->pwroff_gpio)) {
+ if (apb->pwroff_gpio < 0) {
dev_info(dev, "failed to get power off gpio\n");
return apb->pwroff_gpio;
}
/* Do not make clock mandatory as of now (for DB3) */
apb->clk_en_gpio = of_get_named_gpio(np, "clock-en-gpio", 0);
- if (!gpio_is_valid(apb->clk_en_gpio))
+ if (apb->clk_en_gpio < 0)
dev_err(dev, "failed to get clock en gpio\n");
apb->pwrdn_gpio = of_get_named_gpio(np, "pwr-down-gpios", 0);
- if (!gpio_is_valid(apb->pwrdn_gpio))
+ if (apb->pwrdn_gpio < 0)
dev_info(dev, "failed to get power down gpio\n");
/* Regulators are optional, as we may have fixed supply coming in */