summaryrefslogtreecommitdiff
path: root/drivers/w1/w1.c
diff options
context:
space:
mode:
authorDavid Fries <David@Fries.net>2014-01-15 22:29:17 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-07 15:40:17 -0800
commit70b34d2ed807b722413894975a8c60617defb887 (patch)
tree5dd0073cdfb48471130284bf3727223e3a100530 /drivers/w1/w1.c
parent3c6955e5aa2a7ebf18a44486be6a7f047811650b (diff)
w1: new netlink commands, add/remove/list slaves
Introduce new commands to add, remove, and list slave devices through the netlink interface. This can be useful to skip the search on a static network. They could previously only be added or removed through automatic search or sysfs, and this allows a program to only use netlink. Only allocate memory when needed, so move kzalloc into w1_get_slaves where it was used. Signed-off-by: David Fries <David@Fries.net> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r--drivers/w1/w1.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 4c89f85edfe6..97b35cb8b6da 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -56,8 +56,6 @@ module_param_named(slave_ttl, w1_max_slave_ttl, int, 0);
DEFINE_MUTEX(w1_mlock);
LIST_HEAD(w1_masters);
-static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn);
-
static int w1_master_match(struct device *dev, struct device_driver *drv)
{
return 1;
@@ -444,7 +442,7 @@ static int w1_atoreg_num(struct device *dev, const char *buf, size_t count,
/* Searches the slaves in the w1_master and returns a pointer or NULL.
* Note: must hold the mutex
*/
-static struct w1_slave *w1_slave_search_device(struct w1_master *dev,
+struct w1_slave *w1_slave_search_device(struct w1_master *dev,
struct w1_reg_num *rn)
{
struct w1_slave *sl;
@@ -711,7 +709,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
return 0;
}
-static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
+int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
{
struct w1_slave *sl;
struct w1_family *f;