Commit 7785925d authored by Evgeniy Polyakov's avatar Evgeniy Polyakov Committed by Greg Kroah-Hartman

[PATCH] w1: cleanups.

 - white space changes.
 - list_for_each_entry/list_for_each_entry_safe and reverse changes.
 - small coding style changes.
 - removed redundant NULL checks.
 - use attribute group and macros instead of direct device attributes.
Patch is havily based on work from Adrian Bunk and Dmitry Torokhov,
thanks guys.
Signed-off-by: default avatarEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 85e941cc
...@@ -30,7 +30,7 @@ config W1_DS9490 ...@@ -30,7 +30,7 @@ config W1_DS9490
This support is also available as a module. If so, the module This support is also available as a module. If so, the module
will be called ds9490r.ko. will be called ds9490r.ko.
config W1_DS9490_BRIDGE config W1_DS9490R_BRIDGE
tristate "DS9490R USB <-> W1 transport layer for 1-wire" tristate "DS9490R USB <-> W1 transport layer for 1-wire"
depends on W1_DS9490 depends on W1_DS9490
help help
......
This diff is collapsed.
...@@ -137,7 +137,6 @@ struct w1_master ...@@ -137,7 +137,6 @@ struct w1_master
}; };
int w1_create_master_attributes(struct w1_master *); int w1_create_master_attributes(struct w1_master *);
void w1_destroy_master_attributes(struct w1_master *);
void w1_search(struct w1_master *dev); void w1_search(struct w1_master *dev);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -39,8 +39,9 @@ extern spinlock_t w1_mlock; ...@@ -39,8 +39,9 @@ extern spinlock_t w1_mlock;
extern int w1_process(void *); extern int w1_process(void *);
struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl, static struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
struct device_driver *driver, struct device *device) struct device_driver *driver,
struct device *device)
{ {
struct w1_master *dev; struct w1_master *dev;
int err; int err;
...@@ -105,7 +106,7 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl, ...@@ -105,7 +106,7 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
return dev; return dev;
} }
void w1_free_dev(struct w1_master *dev) static void w1_free_dev(struct w1_master *dev)
{ {
device_unregister(&dev->dev); device_unregister(&dev->dev);
if (dev->nls && dev->nls->sk_socket) if (dev->nls && dev->nls->sk_socket)
...@@ -197,10 +198,8 @@ void __w1_remove_master_device(struct w1_master *dev) ...@@ -197,10 +198,8 @@ void __w1_remove_master_device(struct w1_master *dev)
void w1_remove_master_device(struct w1_bus_master *bm) void w1_remove_master_device(struct w1_bus_master *bm)
{ {
struct w1_master *dev = NULL; struct w1_master *dev = NULL;
struct list_head *ent, *n;
list_for_each_safe(ent, n, &w1_masters) { list_for_each_entry(dev, &w1_masters, w1_master_entry) {
dev = list_entry(ent, struct w1_master, w1_master_entry);
if (!dev->initialized) if (!dev->initialized)
continue; continue;
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#include "w1.h" #include "w1.h"
struct w1_master * w1_alloc_dev(u32, int, int, struct device_driver *, struct device *);
void w1_free_dev(struct w1_master *dev);
int w1_add_master_device(struct w1_bus_master *); int w1_add_master_device(struct w1_bus_master *);
void w1_remove_master_device(struct w1_bus_master *); void w1_remove_master_device(struct w1_bus_master *);
void __w1_remove_master_device(struct w1_master *); void __w1_remove_master_device(struct w1_master *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment