linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/imx: remove autodetection
@ 2010-11-24  9:05 Uwe Kleine-König
       [not found] ` <1290589546-21662-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2010-11-24  9:05 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Jason Wang, kernel-bIcnvbaLZ9MEGnE8C9+IrQ

there are no machines in-tree that still use the driver
name as device name.  So save a few bytes and remove it.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi_imx.c |   30 ++----------------------------
 1 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 55a38e2..9010ef0 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -66,7 +66,6 @@ enum spi_imx_devtype {
 	SPI_IMX_VER_0_5,
 	SPI_IMX_VER_0_7,
 	SPI_IMX_VER_2_3,
-	SPI_IMX_VER_AUTODETECT,
 };
 
 struct spi_imx_data;
@@ -720,9 +719,6 @@ static void spi_imx_cleanup(struct spi_device *spi)
 
 static struct platform_device_id spi_imx_devtype[] = {
 	{
-		.name = DRIVER_NAME,
-		.driver_data = SPI_IMX_VER_AUTODETECT,
-	}, {
 		.name = "imx1-cspi",
 		.driver_data = SPI_IMX_VER_IMX1,
 	}, {
@@ -802,30 +798,8 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
 
 	init_completion(&spi_imx->xfer_done);
 
-	if (pdev->id_entry->driver_data == SPI_IMX_VER_AUTODETECT) {
-		if (cpu_is_mx25() || cpu_is_mx35())
-			spi_imx->devtype_data =
-				spi_imx_devtype_data[SPI_IMX_VER_0_7];
-		else if (cpu_is_mx25() || cpu_is_mx31() || cpu_is_mx35())
-			spi_imx->devtype_data =
-				spi_imx_devtype_data[SPI_IMX_VER_0_4];
-		else if (cpu_is_mx27() || cpu_is_mx21())
-			spi_imx->devtype_data =
-				spi_imx_devtype_data[SPI_IMX_VER_0_0];
-		else if (cpu_is_mx1())
-			spi_imx->devtype_data =
-				spi_imx_devtype_data[SPI_IMX_VER_IMX1];
-		else
-			BUG();
-	} else
-		spi_imx->devtype_data =
-			spi_imx_devtype_data[pdev->id_entry->driver_data];
-
-	if (!spi_imx->devtype_data.intctrl) {
-		dev_err(&pdev->dev, "no support for this device compiled in\n");
-		ret = -ENODEV;
-		goto out_gpio_free;
-	}
+	spi_imx->devtype_data =
+		spi_imx_devtype_data[pdev->id_entry->driver_data];
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
-- 
1.7.2.3


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* Re: [PATCH] spi/imx: remove autodetection
       [not found] ` <1290589546-21662-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2010-11-25  4:03   ` Jason Wang
       [not found]     ` <4CEDE01F.5050109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Wang @ 2010-11-25  4:03 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Jason Wang,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

It is reasonable, looks fine to me. :-)

Jason.

Uwe Kleine-König wrote:
> there are no machines in-tree that still use the driver
> name as device name.  So save a few bytes and remove it.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/spi/spi_imx.c |   30 ++----------------------------
>  1 files changed, 2 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
> index 55a38e2..9010ef0 100644
> --- a/drivers/spi/spi_imx.c
> +++ b/drivers/spi/spi_imx.c
> @@ -66,7 +66,6 @@ enum spi_imx_devtype {
>  	SPI_IMX_VER_0_5,
>  	SPI_IMX_VER_0_7,
>  	SPI_IMX_VER_2_3,
> -	SPI_IMX_VER_AUTODETECT,
>  };
>  
>  struct spi_imx_data;
> @@ -720,9 +719,6 @@ static void spi_imx_cleanup(struct spi_device *spi)
>  
>  static struct platform_device_id spi_imx_devtype[] = {
>  	{
> -		.name = DRIVER_NAME,
> -		.driver_data = SPI_IMX_VER_AUTODETECT,
> -	}, {
>  		.name = "imx1-cspi",
>  		.driver_data = SPI_IMX_VER_IMX1,
>  	}, {
> @@ -802,30 +798,8 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
>  
>  	init_completion(&spi_imx->xfer_done);
>  
> -	if (pdev->id_entry->driver_data == SPI_IMX_VER_AUTODETECT) {
> -		if (cpu_is_mx25() || cpu_is_mx35())
> -			spi_imx->devtype_data =
> -				spi_imx_devtype_data[SPI_IMX_VER_0_7];
> -		else if (cpu_is_mx25() || cpu_is_mx31() || cpu_is_mx35())
> -			spi_imx->devtype_data =
> -				spi_imx_devtype_data[SPI_IMX_VER_0_4];
> -		else if (cpu_is_mx27() || cpu_is_mx21())
> -			spi_imx->devtype_data =
> -				spi_imx_devtype_data[SPI_IMX_VER_0_0];
> -		else if (cpu_is_mx1())
> -			spi_imx->devtype_data =
> -				spi_imx_devtype_data[SPI_IMX_VER_IMX1];
> -		else
> -			BUG();
> -	} else
> -		spi_imx->devtype_data =
> -			spi_imx_devtype_data[pdev->id_entry->driver_data];
> -
> -	if (!spi_imx->devtype_data.intctrl) {
> -		dev_err(&pdev->dev, "no support for this device compiled in\n");
> -		ret = -ENODEV;
> -		goto out_gpio_free;
> -	}
> +	spi_imx->devtype_data =
> +		spi_imx_devtype_data[pdev->id_entry->driver_data];
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
>   


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* Re: [PATCH] spi/imx: remove autodetection
       [not found]     ` <4CEDE01F.5050109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2010-11-25  8:05       ` Uwe Kleine-König
       [not found]         ` <20101125080500.GF4693-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2010-11-25  8:05 UTC (permalink / raw)
  To: Jason Wang
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Thu, Nov 25, 2010 at 12:03:43PM +0800, Jason Wang wrote:
> It is reasonable, looks fine to me. :-)
>
> Jason.
I'll interpret this as an Ack.

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev

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

* Re: [PATCH] spi/imx: remove autodetection
       [not found]         ` <20101125080500.GF4693-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2010-12-24  2:19           ` Grant Likely
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2010-12-24  2:19 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Jason Wang,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Thu, Nov 25, 2010 at 09:05:00AM +0100, Uwe Kleine-König wrote:
> On Thu, Nov 25, 2010 at 12:03:43PM +0800, Jason Wang wrote:
> > It is reasonable, looks fine to me. :-)
> >
> > Jason.
> I'll interpret this as an Ack.

So will I.  :-)

applied for -next

g.


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

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

end of thread, other threads:[~2010-12-24  2:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-24  9:05 [PATCH] spi/imx: remove autodetection Uwe Kleine-König
     [not found] ` <1290589546-21662-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-11-25  4:03   ` Jason Wang
     [not found]     ` <4CEDE01F.5050109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-25  8:05       ` Uwe Kleine-König
     [not found]         ` <20101125080500.GF4693-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-12-24  2:19           ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).