Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a957a14b authored by David Cohen's avatar David Cohen Committed by H. Peter Anvin
Browse files

x86, intel-mid: Check get_gpio_by_name() error code on platform code



This patch does cleanup on all intel mid platform code that uses
gpio_get_by_name() function. From now on they should check for any error
code instead of only hardcoded -1.

There are no functional changes from this change.

Signed-off-by: default avatarDavid Cohen <david.a.cohen@linux.intel.com>
Link: http://lkml.kernel.org/r/1389913624-9149-3-git-send-email-david.a.cohen@linux.intel.com


Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent acb20d73
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -22,7 +22,9 @@ static void __init *emc1403_platform_data(void *info)
	int intr = get_gpio_by_name("thermal_int");
	int intr2nd = get_gpio_by_name("thermal_alert");

	if (intr == -1 || intr2nd == -1)
	if (intr < 0)
		return NULL;
	if (intr2nd < 0)
		return NULL;

	i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ static int __init pb_keys_init(void)
		gb[i].gpio = get_gpio_by_name(gb[i].desc);
		pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc,
					gb[i].gpio);
		if (gb[i].gpio == -1)
		if (gb[i].gpio < 0)
			continue;

		if (i != good)
+3 −1
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@ static void __init *lis331dl_platform_data(void *info)
	int intr = get_gpio_by_name("accel_int");
	int intr2nd = get_gpio_by_name("accel_2");

	if (intr == -1 || intr2nd == -1)
	if (intr < 0)
		return NULL;
	if (intr2nd < 0)
		return NULL;

	i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ static void __init *max7315_platform_data(void *info)
	gpio_base = get_gpio_by_name(base_pin_name);
	intr = get_gpio_by_name(intr_pin_name);

	if (gpio_base == -1)
	if (gpio_base < 0)
		return NULL;
	max7315->gpio_base = gpio_base;
	if (intr != -1) {
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ static void *mpu3050_platform_data(void *info)
	struct i2c_board_info *i2c_info = info;
	int intr = get_gpio_by_name("mpu3050_int");

	if (intr == -1)
	if (intr < 0)
		return NULL;

	i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
Loading