Re: [PATCH 2/6] staging:iio:dds:ad9834 unwind use of is_visible for attrs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/02/2012 06:25 PM, Jonathan Cameron wrote:
> Trivial usecase in which just having two different attr
> groups covers all options.  Slightly more code, but a simpler
> to follow result.
> 

>  static int __devinit ad9834_probe(struct spi_device *spi)
>  {
>  	struct ad9834_platform_data *pdata = spi->dev.platform_data;
> @@ -344,7 +347,10 @@ static int __devinit ad9834_probe(struct spi_device *spi)
>  	st->reg = reg;
>  	indio_dev->dev.parent = &spi->dev;
>  	indio_dev->name = spi_get_device_id(spi)->name;
> -	indio_dev->info = &ad9834_info;
> +	if ((st->devid == ID_AD9833) || (st->devid == ID_AD9837))

Maybe use a switch statement.

> +		indio_dev->info = &ad9833_info;
> +	else
> +		indio_dev->info = &ad9834_info;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  
>  	/* Setup default messages */

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


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux