Hi! > >+ led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL); > >+ if (!led) > >+ return -ENOMEM; > >+ > >+ led->spi = spi; > >+ strlcpy(led->name, name, sizeof(led->name)); > >+ mutex_init(&led->mutex); > >+ led->off_value = off_value; > >+ led->max_value = max_value; > >+ led->ldev.name = led->name; > >+ led->ldev.brightness = LED_OFF; > > This line is redundant - already zeroed by kzalloc. Actually I'd prefer to leave it in. Yes, LED_OFF == 0, and will probably stay == 0 in future, but... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Attachment:
signature.asc
Description: Digital signature