Re: [PATCH] new driver for TLV320AIC23B

From: Alexey Dobriyan
Date: Wed May 10 2006 - 18:33:07 EST


On Wed, May 10, 2006 at 02:55:28PM -0700, Scott Alfter wrote:
> the attached patch adds a
> driver for the TI TLV320AIC23B audio codec. It implements analog audio capture
> at 32, 44.1, and 48 kHz (16-bit stereo). The hardware is capable of more (it
> supports more sample rates and includes analog output), but in its current
> form, the driver works well with ivtv.

> --- linux-2.6.16-gentoo-r1/drivers/media/video/tlv320aic23b.c
> +++ linux-2.6.16-gentoo-r1/drivers/media/video/tlv320aic23b.c

> +static int tlv320aic23b_attach(struct i2c_adapter *adapter, int address, int kind)
> +{
> + struct i2c_client *client;
> + struct tlv320aic23b_state *state;
> +
> + /* Check if the adapter supports the needed features */
> + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
> + return 0;
> +
> + client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
> + if (client == 0)
> + return -ENOMEM;

client is a pointer, so

if (client == NULL)

or

if (!client)

> + snprintf(client->name, sizeof(client->name) - 1, "tlv320aic23b");

snprintf(buf, sizeof(buf), ...)

is idiomatic.

> +static int tlv320aic23b_detach(struct i2c_client *client)
> +{
> + int err;
> +
> + err = i2c_detach_client(client);
> + if (err) {
> + return err;
> + }

Preferred style is

if (err)
return err;

> diff -Nupr -X dontdiff linux-2.6.16-gentoo-r1/drivers/media/video/tlv320aic23b.mod.c linux-2.6.16-gentoo-r1/drivers/media/video/tlv320aic23b.mod.c

> --- linux-2.6.16-gentoo-r1/drivers/media/video/tlv320aic23b.mod.c
> +++ linux-2.6.16-gentoo-r1/drivers/media/video/tlv320aic23b.mod.c

This file is generated and you have outdated dontdiff. Use "-X Documentation/dontdiff".

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/