drivers/gpio/gpio-xtensa: fix driver build
diff mbox series

Message ID 20191126193027.11970-1-jcmvbkbc@gmail.com
State New
Headers show
Series
  • drivers/gpio/gpio-xtensa: fix driver build
Related show

Commit Message

Max Filippov Nov. 26, 2019, 7:30 p.m. UTC
Commit cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") removed
{RSR,WSR}_CPENABLE from xtensa code, but did not fix up all users,
breaking gpio-xtensa driver build.
Update gpio-xtensa to use new xtensa_{get,set}_sr API.

Cc: stable@vger.kernel.org # v5.0+
Fixes: cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 drivers/gpio/gpio-xtensa.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Bartosz Golaszewski Nov. 27, 2019, 7:29 a.m. UTC | #1
wt., 26 lis 2019 o 20:30 Max Filippov <jcmvbkbc@gmail.com> napisaƂ(a):
>
> Commit cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") removed
> {RSR,WSR}_CPENABLE from xtensa code, but did not fix up all users,
> breaking gpio-xtensa driver build.
> Update gpio-xtensa to use new xtensa_{get,set}_sr API.
>
> Cc: stable@vger.kernel.org # v5.0+
> Fixes: cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr")
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  drivers/gpio/gpio-xtensa.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-xtensa.c b/drivers/gpio/gpio-xtensa.c
> index 43d3fa5f511a..0fb2211f9573 100644
> --- a/drivers/gpio/gpio-xtensa.c
> +++ b/drivers/gpio/gpio-xtensa.c
> @@ -44,15 +44,14 @@ static inline unsigned long enable_cp(unsigned long *cpenable)
>         unsigned long flags;
>
>         local_irq_save(flags);
> -       RSR_CPENABLE(*cpenable);
> -       WSR_CPENABLE(*cpenable | BIT(XCHAL_CP_ID_XTIOP));
> -
> +       *cpenable = xtensa_get_sr(cpenable);
> +       xtensa_set_sr(*cpenable | BIT(XCHAL_CP_ID_XTIOP), cpenable);
>         return flags;
>  }
>
>  static inline void disable_cp(unsigned long flags, unsigned long cpenable)
>  {
> -       WSR_CPENABLE(cpenable);
> +       xtensa_set_sr(cpenable, cpenable);
>         local_irq_restore(flags);
>  }
>
> --
> 2.20.1
>

Patch applied, thanks!

Bart

Patch
diff mbox series

diff --git a/drivers/gpio/gpio-xtensa.c b/drivers/gpio/gpio-xtensa.c
index 43d3fa5f511a..0fb2211f9573 100644
--- a/drivers/gpio/gpio-xtensa.c
+++ b/drivers/gpio/gpio-xtensa.c
@@ -44,15 +44,14 @@  static inline unsigned long enable_cp(unsigned long *cpenable)
 	unsigned long flags;
 
 	local_irq_save(flags);
-	RSR_CPENABLE(*cpenable);
-	WSR_CPENABLE(*cpenable | BIT(XCHAL_CP_ID_XTIOP));
-
+	*cpenable = xtensa_get_sr(cpenable);
+	xtensa_set_sr(*cpenable | BIT(XCHAL_CP_ID_XTIOP), cpenable);
 	return flags;
 }
 
 static inline void disable_cp(unsigned long flags, unsigned long cpenable)
 {
-	WSR_CPENABLE(cpenable);
+	xtensa_set_sr(cpenable, cpenable);
 	local_irq_restore(flags);
 }