RE: [PATCH v1 2/3] OMAP4: Ethernet: KS8851 Board Support

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

 



> -----Original Message-----
> From: linux-omap-owner@xxxxxxxxxxxxxxx [mailto:linux-omap-owner@xxxxxxxxxxxxxxx] On Behalf Of G,
> Manjunath Kondaiah
> Sent: Thursday, May 06, 2010 2:34 PM
> To: Arce, Abraham; Tony Lindgren
> Cc: linux-omap@xxxxxxxxxxxxxxx; spi-devel-general@xxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [PATCH v1 2/3] OMAP4: Ethernet: KS8851 Board Support
> 
> 
> 
> > -----Original Message-----
> > From: Arce, Abraham
> > Sent: Thursday, May 06, 2010 9:49 AM
> > To: G, Manjunath Kondaiah; Tony Lindgren
> > Cc: linux-omap@xxxxxxxxxxxxxxx;
> > spi-devel-general@xxxxxxxxxxxxxxxxxxxxx
> > Subject: RE: [PATCH v1 2/3] OMAP4: Ethernet: KS8851 Board Support
> >
> > Manjunath,
> >
> > > > > > > > > +
> > > > > > > > > +static void omap_ethernet_init(void)
> > > > > > > > > +{
> > > > > > > > > +
> > gpio_request(ETHERNET_KS8851_POWER_ENABLE, "ethernet");
> > > > > > > > > +
> > gpio_direction_output(ETHERNET_KS8851_POWER_ENABLE, 1);
> > > > > > > > > +	gpio_request(ETHERNET_KS8851_QUART, "quart");
> > > > > > > > > +	gpio_direction_output(ETHERNET_KS8851_QUART, 1);
> > > > > > > > > +	gpio_request(ETHERNET_KS8851_IRQ, "ks8851");
> > > > > > > >
> > > > > > > > Any reason for not checking return value of
> > gpio_request()?
> > > > > > > >
> >
> > [snip]
> >
> > > Minor changes:
> > > if (gpio_request(x))
> > > 	return status;
> > > if (gpio_request(y))
> > > 	goto err1;
> > > if (gpio_request(z))
> > > 	goto err2;
> > > ...
> > > 	return 0;
> > >
> > > err2:
> > > 	free(y);
> > >
> > > err1:
> > > 	free(x);
> > > 	return status;
> >
> > How about this patch?
> >
> > Note. I am thinking in spi_register_board_info registration:
> >
> > 1. to be done if ethernet fails, other spi dev can be added in future
> 
> No use. Since, for a given board SPI chip select lines are physically
> connected to external slave devices, you can't register another SPI
> slave device for same chip select.
Be careful here Manju. There are 4 channels per SPI controller
with 4 chip selects. You can add more devices on same controller

> 
> > 2. not to be done if ethernet fails, no other dev in spi bus 1 for now
> >
> > What is the best approach? Is it to keep #2?
> 
> Seems to be ok for chip select #0. If we have another device on bus 1 with
> different chip select number, then registration should succeed. However, this
> may not be the case with omap4 sdp board since it might have only one spi
> device on bus1.
There is a quad-uart on SPI but not being used though.
> 
> -Manjunath--
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux