> -----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. > 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. -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