[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071215234024.2B4DA10C75D@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
Date:	Sat, 15 Dec 2007 15:40:24 -0800
From:	David Brownell <david-b@...bell.net>
To:	linux-kernel@...r.kernel.org, i2c@...sensors.org,
	eric.y.miao@...il.com
Cc:	khali@...ux-fr.org, bgardner@...tec.com
Subject: Re: [PATCH 2.6.24-rc5-mm 1/3] gpiolib: basic support for 16-bit 
 PCA9539 GPIO expander
> +	/* initialize cached registers from their original values */
> +	pca9539_read_reg(chip, PCA9539_OUTPUT, &chip->reg_output);
> +	pca9539_read_reg(chip, PCA9539_DIRECTION, &chip->reg_direction);
> +
> +	/* set platform specific polarity inversion */
> +	pca9539_write_reg(chip, PCA9539_INVERT, pdata->invert);
> +
> +	ret = pca9539_init_gpio(chip);
> +	if (ret)
> +		goto out_failed;
I'm glad to see this patch no longer trashes previous chip state,
but there's still an issue in that area.  Surely the code should
	ret = pca9539_read_reg(...)
	if (ret)
		goto out_failed;
and likewise for the write?  If the chip isn't present (and thus
an I/O error is reported), its probe() should fail.
- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists