[PATCH 3/4] spi: imx: Don't require platform data chipselect array

Trent Piepho tpiepho at impinj.com
Wed Oct 18 10:30:10 PDT 2017


On Wed, 2017-10-18 at 10:02 +0100, Julien Thierry wrote:
> > --- a/drivers/spi/spi-imx.c
> > +++ b/drivers/spi/spi-imx.c
> > @@ -1364,13 +1364,15 @@ static int spi_imx_probe(struct platform_device *pdev)
> >   
> >   	if (mxc_platform_info) {
> >   		master->num_chipselect = mxc_platform_info->num_chipselect;
> 
> nit:
> This is only useful when num_chipselect is non-zero (master's memory is 
> zeroed on allocation). So maybe this could be simplified a bit more as:
> 
> if (mxc_platform_info && mxc_platform_info->chipselect) {
> 	master->num_chipselect = mxc_platform_info->num_chipselect;
> 	[...]
> }
> 
> Reducing an indentation level for all the following statements.

Good point, there's nothing else in the platform info to use.


More information about the linux-arm-kernel mailing list