public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Felipe Balbi <me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH] I2C: ISP1301_OMAP: New-style i2c driver updates, part 2
Date: Tue, 18 Mar 2008 14:15:28 +0100	[thread overview]
Message-ID: <20080318141528.53f4b2d8@hyperion.delvare> (raw)
In-Reply-To: <20080316105617.GA4503-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>

Huuuuu, I'm just see this:

On Sun, 16 Mar 2008 12:56:18 +0200, Felipe Balbi wrote:
> -static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
> +static int __init isp1301_probe(struct i2c_client *client)
>  {
>  	int			status;
>  	struct isp1301		*isp;
> -	struct i2c_client	*i2c;
>  
>  	if (the_transceiver)
>  		return 0;
> @@ -1492,45 +1470,29 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
>  	init_timer(&isp->timer);
>  	isp->timer.function = isp1301_timer;
>  	isp->timer.data = (unsigned long) isp;
> -
> -	isp->irq = -1;
> -	isp->c.addr = address;
> -	i2c_set_clientdata(&isp->c, isp);
> -	isp->c.adapter = bus;
> -	isp->c.driver = &isp1301_driver;
> -	strlcpy(isp->c.name, DRIVER_NAME, I2C_NAME_SIZE);
> -	isp->client = i2c = &isp->c;
> +	isp->client = client;
>  
>  	/* if this is a true probe, verify the chip ... */
> -	if (kind < 0) {
> -		status = isp1301_get_u16(isp, ISP1301_VENDOR_ID);
> -		if (status != I2C_VENDOR_ID_PHILIPS) {
> -			dev_dbg(&bus->dev, "addr %d not philips id: %d\n",
> -				address, status);
> -			goto fail1;
> -		}
> -		status = isp1301_get_u16(isp, ISP1301_PRODUCT_ID);
> -		if (status != I2C_PRODUCT_ID_PHILIPS_1301) {
> -			dev_dbg(&bus->dev, "%d not isp1301, %d\n",
> -				address, status);
> -			goto fail1;
> -		}
> +	status = isp1301_get_u16(isp, ISP1301_VENDOR_ID);
> +	if (status != I2C_VENDOR_ID_PHILIPS) {
> +		dev_dbg(&client->dev, "not philips id: %d\n", status);
> +		goto fail1;
> +	}
> +	status = isp1301_get_u16(isp, ISP1301_PRODUCT_ID);
> +	if (status != I2C_PRODUCT_ID_PHILIPS_1301) {
> +		dev_dbg(&client->dev, "not isp1301, %d\n", status);
> +		goto fail1;
>  	}
>  
> -	status = i2c_attach_client(i2c);
> -	if (status < 0) {
> -		dev_dbg(&bus->dev, "can't attach %s to device %d, err %d\n",
> -				DRIVER_NAME, address, status);
>  fail1:
>  		kfree(isp);
>  		return 0;
> -	}

This is an unconditional failure, isn't it? So if I may ask: how did
you test this patch to not notice this?

> -	isp->i2c_release = i2c->dev.release;
> -	i2c->dev.release = isp1301_release;
> +
> +	isp->i2c_release = client->dev.release = isp1301_release;

And this is a functional change which I really doubt was made on
purpose. It will make isp1301_release loop forever.

Don't know about you, but I am seriously tired by this patch. We're
working on it for more than 2 months, it must have seen half a dozen
revisions by now, and it's still broken enough for me to be sure that
it wasn't even tested.

The obvious reason is that this patch does several things at once. It's
not just converting the driver to a new-style i2c driver, it is also
moving the board-specific code out of the driver (or plain killing it
without explanations), and on top of this you add unrelated code
cleanups (or breakage). Patches are supposed to be split into
functional changes that are easy to review and test, exactly to avoid
this situation.

So I'll just drop this patch for now. I can't afford pushing broken
stuff into -mm. Let me know when you have something better and well
tested.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-03-18 13:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-15 12:47 [PATH 0/3] isp1301 changes Felipe Balbi
     [not found] ` <1205585237-21492-1-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:47   ` [PATCH] I2C: Introduce irq_flags in i2c_boardinfo and i2c_client Felipe Balbi
     [not found]     ` <1205585237-21492-2-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:47       ` [PATCH] I2C: ISP1301_OMAP: New-style i2c driver updates, part 1 Felipe Balbi
     [not found]         ` <1205585237-21492-3-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:47           ` [PATCH] I2C: ISP1301_OMAP: New-style i2c driver updates, part 2 Felipe Balbi
     [not found]             ` <1205585237-21492-4-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:49               ` Felipe Balbi
     [not found]                 ` <20080315124918.GA21547-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-15 12:54                   ` Felipe Balbi
     [not found]                     ` <20080315125458.GB21547-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-15 13:13                       ` Felipe Balbi
     [not found]                         ` <20080315131309.GA24990-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-16 10:56                           ` Felipe Balbi
     [not found]                             ` <20080316105617.GA4503-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-16 11:00                               ` [PATCH] I2C: ISP1301: Sync with linux-omap Felipe Balbi
     [not found]                                 ` <20080316110033.GB4503-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-16 17:59                                   ` David Brownell
     [not found]                                     ` <200803161059.52278.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-03-16 18:18                                       ` Felipe Balbi
2008-03-18 12:46                                   ` Jean Delvare
     [not found]                                     ` <20080318134633.16f6e5f1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:09                                       ` Felipe Balbi
     [not found]                                         ` <31e679430803180609s2b404dabu1cac2e09f128ba96-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-18 13:23                                           ` Jean Delvare
     [not found]                                             ` <20080318142337.0f9a2b5b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:28                                               ` Felipe Balbi
     [not found]                                                 ` <31e679430803180628h7a4926a2t4e540d9617522e28-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-20  9:39                                                   ` David Brownell
2008-03-16 17:55                               ` [PATCH] I2C: ISP1301_OMAP: New-style i2c driver updates, part 2 David Brownell
2008-03-18 12:42                               ` Jean Delvare
     [not found]                                 ` <20080318134259.1b7e2878-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:06                                   ` Felipe Balbi
     [not found]                                     ` <31e679430803180606w51e5538ar1df7fbdfa5a0e894-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-18 13:27                                       ` Jean Delvare
     [not found]                                         ` <20080318142716.74d65ba1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-20  9:44                                           ` David Brownell
2008-03-18 13:15                               ` Jean Delvare [this message]
     [not found]                                 ` <20080318141528.53f4b2d8-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:25                                   ` Felipe Balbi
2008-03-20  9:56                               ` David Brownell
2008-03-31 17:37                               ` Ben Dooks
     [not found]                                 ` <20080331173749.GA10234-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-03-31 18:41                                   ` Jean Delvare
2008-03-15 15:28   ` [PATH 0/3] isp1301 changes Jean Delvare
     [not found]     ` <20080315162832.067b8088-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-15 15:38       ` Felipe Balbi
     [not found]         ` <31e679430803150838n6638be05k53800bb74eeb3462-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-15 15:40           ` Felipe Balbi
     [not found]             ` <31e679430803150840p334e8d17ncdd1fdc431de8d82-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-15 16:47               ` Jean Delvare
     [not found]                 ` <20080315174731.29cfb554-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-15 23:22                   ` Felipe Balbi
2008-03-16  3:57               ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080318141528.53f4b2d8@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox