Hi, On Thu, Apr 29, 2010 at 05:05:56PM +0200, matthias wrote: > 2010/4/29 Greg KH <greg@xxxxxxxxx>: > > On Thu, Apr 29, 2010 at 09:54:08AM +0200, matthias wrote: > >> 2010/4/28 Greg KH <gregkh@xxxxxxx>: > >> > On Wed, Apr 28, 2010 at 08:45:35PM +0200, matthias wrote: > >> >> This drivers allows a communication with the Analog Devices ADIS16255 > >> >> Low Power Gyroscope over SPI. > >> > > >> > Why is this going to be a staging driver? Is there a problem with it > >> > going into the main portion of the kernel now? > >> > >> - No one else has tested it, so I think if it stays in staging, others > >> have the possibility to test it. > >> - It has checkpatch issues > >> - Odd stuff like the AD_CHK(_ss) macro > >> - I'm not sure to which subsystem it should be added (maybe industrial > >> io, but this is still staging. Any suggestions?) > >> - Improvements of code on protocol hierarchy needed (e.g. shutdown > >> device commands in remove function; it is not obvious which sample > >> rate the device uses) > > > > Ok, can you resend it after fixing the email problem, and add a TODO > > file that lists these things and puts your email as the person to > > contact about the driver? > > Yes, here we go. I added most of the things Jiri mentioned. > > Signed-off-by: Matthias Brugger <mensch0815@xxxxxxxxx> There's a little typo in this function: > +static int spi_adis16255_write_data(struct spi_adis16255_data *spiadis, > + u8 adr1, > + u8 adr2, > + u8 *wbuf) > +{ > + struct spi_device *spi = spiadis->spi; > + struct spi_message msg; > + struct spi_transfer xfer1, xfer2; > + u8 *buf, *rx; > + int ret; > + > + buf = kmalloc(4, GFP_KERNEL); > + if (buf == NULL) > + return -ENOMEM; > + > + rx = kzalloc(4, GFP_KERNEL); > + if (rx == NULL) { > + ret = -ENOMEM; > + goto err_buf; > + } > + > + spi_message_init(&msg); > + memset(&xfer1, 0, sizeof(xfer1)); > + memset(&xfer2, 0, sizeof(xfer2)); > + > + buf[0] = adr1 | 0x80; > + buf[1] = *wbuf; > + > + buf[2] = adr2 | 0x80; > + buf[3] = *(wbuf + 1); > + > + xfer1.tx_buf = buf; > + xfer1.rx_buf = rx; > + xfer1.len = 2; > + xfer1.delay_usecs = 9; > + > + xfer2.tx_buf = buf+2; > + xfer2.rx_buf = rx+2; > + xfer2.len = 2; > + > + spi_message_add_tail(&xfer1, &msg); > + spi_message_add_tail(&xfer2, &msg); > + > + ret = spi_sync(spi, &msg); > + if (ret != 0) > + dev_warn(&spi->dev, "wirte data to %#x %#x failed\n", > + buf[0], buf[2]); wirte -> write -- Charles Clément _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel