public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] platform/x86: intel_int0002_vgpio: Get rid of custom ICPU() macro
@ 2019-06-19 14:50 Andy Shevchenko
  2019-06-25 20:31 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2019-06-19 14:50 UTC (permalink / raw)
  To: Darren Hart, platform-driver-x86, Hans de Goede, linux-kernel
  Cc: Andy Shevchenko

Replace custom grown macro with generic INTEL_CPU_FAM6() one.

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/platform/x86/intel_int0002_vgpio.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c
index 1694a9aec77c..d9542c661ddc 100644
--- a/drivers/platform/x86/intel_int0002_vgpio.c
+++ b/drivers/platform/x86/intel_int0002_vgpio.c
@@ -51,17 +51,6 @@
 #define GPE0A_STS_PORT			0x420
 #define GPE0A_EN_PORT			0x428
 
-#define BAYTRAIL			0x01
-#define CHERRYTRAIL			0x02
-
-#define ICPU(model, data) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, data }
-
-static const struct x86_cpu_id int0002_cpu_ids[] = {
-	ICPU(INTEL_FAM6_ATOM_SILVERMONT, BAYTRAIL), /* Valleyview, Bay Trail  */
-	ICPU(INTEL_FAM6_ATOM_AIRMONT, CHERRYTRAIL), /* Braswell, Cherry Trail */
-	{}
-};
-
 /*
  * As this is not a real GPIO at all, but just a hack to model an event in
  * ACPI the get / set functions are dummy functions.
@@ -157,6 +146,12 @@ static struct irq_chip int0002_cht_irqchip = {
 	 */
 };
 
+static const struct x86_cpu_id int0002_cpu_ids[] = {
+	INTEL_CPU_FAM6(ATOM_SILVERMONT, int0002_byt_irqchip),	/* Valleyview, Bay Trail  */
+	INTEL_CPU_FAM6(ATOM_AIRMONT, int0002_cht_irqchip),	/* Braswell, Cherry Trail */
+	{}
+};
+
 static int int0002_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -210,10 +205,7 @@ static int int0002_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	if (cpu_id->driver_data == BAYTRAIL)
-		irq_chip = &int0002_byt_irqchip;
-	else
-		irq_chip = &int0002_cht_irqchip;
+	irq_chip = (struct irq_chip *)cpu_id->driver_data;
 
 	ret = gpiochip_irqchip_add(chip, irq_chip, 0, handle_edge_irq,
 				   IRQ_TYPE_NONE);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] platform/x86: intel_int0002_vgpio: Get rid of custom ICPU() macro
  2019-06-19 14:50 [PATCH v1] platform/x86: intel_int0002_vgpio: Get rid of custom ICPU() macro Andy Shevchenko
@ 2019-06-25 20:31 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2019-06-25 20:31 UTC (permalink / raw)
  To: Andy Shevchenko, Darren Hart, platform-driver-x86, linux-kernel

Hi,

On 19-06-19 16:50, Andy Shevchenko wrote:
> Replace custom grown macro with generic INTEL_CPU_FAM6() one.
> 
> No functional change intended.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

> ---
>   drivers/platform/x86/intel_int0002_vgpio.c | 22 +++++++---------------
>   1 file changed, 7 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c
> index 1694a9aec77c..d9542c661ddc 100644
> --- a/drivers/platform/x86/intel_int0002_vgpio.c
> +++ b/drivers/platform/x86/intel_int0002_vgpio.c
> @@ -51,17 +51,6 @@
>   #define GPE0A_STS_PORT			0x420
>   #define GPE0A_EN_PORT			0x428
>   
> -#define BAYTRAIL			0x01
> -#define CHERRYTRAIL			0x02
> -
> -#define ICPU(model, data) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, data }
> -
> -static const struct x86_cpu_id int0002_cpu_ids[] = {
> -	ICPU(INTEL_FAM6_ATOM_SILVERMONT, BAYTRAIL), /* Valleyview, Bay Trail  */
> -	ICPU(INTEL_FAM6_ATOM_AIRMONT, CHERRYTRAIL), /* Braswell, Cherry Trail */
> -	{}
> -};
> -
>   /*
>    * As this is not a real GPIO at all, but just a hack to model an event in
>    * ACPI the get / set functions are dummy functions.
> @@ -157,6 +146,12 @@ static struct irq_chip int0002_cht_irqchip = {
>   	 */
>   };
>   
> +static const struct x86_cpu_id int0002_cpu_ids[] = {
> +	INTEL_CPU_FAM6(ATOM_SILVERMONT, int0002_byt_irqchip),	/* Valleyview, Bay Trail  */
> +	INTEL_CPU_FAM6(ATOM_AIRMONT, int0002_cht_irqchip),	/* Braswell, Cherry Trail */
> +	{}
> +};
> +
>   static int int0002_probe(struct platform_device *pdev)
>   {
>   	struct device *dev = &pdev->dev;
> @@ -210,10 +205,7 @@ static int int0002_probe(struct platform_device *pdev)
>   		return ret;
>   	}
>   
> -	if (cpu_id->driver_data == BAYTRAIL)
> -		irq_chip = &int0002_byt_irqchip;
> -	else
> -		irq_chip = &int0002_cht_irqchip;
> +	irq_chip = (struct irq_chip *)cpu_id->driver_data;
>   
>   	ret = gpiochip_irqchip_add(chip, irq_chip, 0, handle_edge_irq,
>   				   IRQ_TYPE_NONE);
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-25 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-19 14:50 [PATCH v1] platform/x86: intel_int0002_vgpio: Get rid of custom ICPU() macro Andy Shevchenko
2019-06-25 20:31 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox