diff mbox series

[v1,1/2] pinctrl: baytrail: Use defined macro instead of magic in byt_get_gpio_mux()

Message ID 20190703003018.75186-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/2] pinctrl: baytrail: Use defined macro instead of magic in byt_get_gpio_mux() | expand

Commit Message

Andy Shevchenko July 3, 2019, 12:30 a.m. UTC
By the fact byt_get_gpio_mux() returns a value of mux settings as
it is represented in hardware. Use defined macro instead of magic numbers
to clarify this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/intel/pinctrl-baytrail.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Enrico Weigelt, metux IT consult July 3, 2019, 9:44 a.m. UTC | #1
On 03.07.19 02:30, Andy Shevchenko wrote:
> By the fact byt_get_gpio_mux() returns a value of mux settings as
> it is represented in hardware. Use defined macro instead of magic numbers
> to clarify this.

Reviewed-By: Enrico Weigelt <info@metux.net>
Mika Westerberg July 3, 2019, 11 a.m. UTC | #2
On Wed, Jul 03, 2019 at 03:30:17AM +0300, Andy Shevchenko wrote:
> By the fact byt_get_gpio_mux() returns a value of mux settings as
> it is represented in hardware. Use defined macro instead of magic numbers
> to clarify this.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Linus Walleij July 4, 2019, 7:50 a.m. UTC | #3
On Wed, Jul 3, 2019 at 2:30 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> By the fact byt_get_gpio_mux() returns a value of mux settings as
> it is represented in hardware. Use defined macro instead of magic numbers
> to clarify this.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied directly with the ACKs.

A bit late for administrating pull requests now, so I just
apply this stuff.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index 18d9ad504194..c72d831ca8b6 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -91,6 +91,7 @@ 
  * does not find a match for the requested function.
  */
 #define BYT_DEFAULT_GPIO_MUX	0
+#define BYT_ALTER_GPIO_MUX	1
 
 struct byt_gpio_pin_context {
 	u32 conf0;
@@ -932,14 +933,14 @@  static u32 byt_get_gpio_mux(struct byt_gpio *vg, unsigned int offset)
 	/* SCORE pin 92-93 */
 	if (!strcmp(vg->soc_data->uid, BYT_SCORE_ACPI_UID) &&
 	    offset >= 92 && offset <= 93)
-		return 1;
+		return BYT_ALTER_GPIO_MUX;
 
 	/* SUS pin 11-21 */
 	if (!strcmp(vg->soc_data->uid, BYT_SUS_ACPI_UID) &&
 	    offset >= 11 && offset <= 21)
-		return 1;
+		return BYT_ALTER_GPIO_MUX;
 
-	return 0;
+	return BYT_DEFAULT_GPIO_MUX;
 }
 
 static void byt_gpio_clear_triggering(struct byt_gpio *vg, unsigned int offset)