Re: [PATCH] leds: leds-pca9532 cleanups

From: Dmitry Torokhov
Date: Thu Dec 16 2010 - 12:37:38 EST


On Thu, Dec 16, 2010 at 05:05:53PM +0800, Axel Lin wrote:
> >From 6244111ba78a6768ded3fedf8967b6bc891fa757 Mon Sep 17 00:00:00 2001
> From: Axel Lin <axel.lin@xxxxxxxxx>
> Date: Thu, 16 Dec 2010 15:41:55 +0800
> Subject: [PATCH] leds: leds-pca9532 cleanups
>
> This patch includes below fixes:
> 1. Remove unneeded input_free_device() after input_unregister_device().
> 2. Use "while (--i >= 0)" instead of "if (i > 0) for (i = i - 1; i >= 0; i--)"
> for reclaim resources in pca9532_configure() error path.
> I think this change improves readability.

The whole chunk should be in a separate function, like

void pca9532_destroy_devices(struct pca9532_data *data, int n_devs);

That can be called from both pca9532_configure() and pca9532_remove().

For the input change:

Acked-by: Dmitry Torokhov <dtor@xxxxxxx>

Thanks.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/