aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/caif_dev.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2011-04-11 06:43:50 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-11 18:08:47 -0400
commit73d6ac633c6c0ca703f90db0b808d9593e46aef6 (patch)
tree738fb16f97e24288f9db9c6b43b4bcee4f794dc6 /net/caif/caif_dev.c
parent1c01a80cfec6f806246f31ff2680cd3639b30e67 (diff)
caif: code cleanup
Cleanup of new CAIF code. * make local functions static * remove code that is never used * expand get_caif_conf() since wrapper is no longer needed * make args to comparison functions const * rename connect_req_to_link_param to keep exported names consistent Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/caif_dev.c')
-rw-r--r--net/caif/caif_dev.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index a42a408306e4..b533bb09a002 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -257,7 +257,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
257 break; 257 break;
258 } 258 }
259 dev_hold(dev); 259 dev_hold(dev);
260 cfcnfg_add_phy_layer(get_caif_conf(), 260 cfcnfg_add_phy_layer(cfg,
261 phy_type, 261 phy_type,
262 dev, 262 dev,
263 &caifd->layer, 263 &caifd->layer,
@@ -300,7 +300,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
300 if (atomic_read(&caifd->in_use)) 300 if (atomic_read(&caifd->in_use))
301 netdev_warn(dev, 301 netdev_warn(dev,
302 "Unregistering an active CAIF device\n"); 302 "Unregistering an active CAIF device\n");
303 cfcnfg_del_phy_layer(get_caif_conf(), &caifd->layer); 303 cfcnfg_del_phy_layer(cfg, &caifd->layer);
304 dev_put(dev); 304 dev_put(dev);
305 atomic_set(&caifd->state, what); 305 atomic_set(&caifd->state, what);
306 break; 306 break;
@@ -322,24 +322,18 @@ static struct notifier_block caif_device_notifier = {
322 .priority = 0, 322 .priority = 0,
323}; 323};
324 324
325
326struct cfcnfg *get_caif_conf(void)
327{
328 return cfg;
329}
330EXPORT_SYMBOL(get_caif_conf);
331
332int caif_connect_client(struct caif_connect_request *conn_req, 325int caif_connect_client(struct caif_connect_request *conn_req,
333 struct cflayer *client_layer, int *ifindex, 326 struct cflayer *client_layer, int *ifindex,
334 int *headroom, int *tailroom) 327 int *headroom, int *tailroom)
335{ 328{
336 struct cfctrl_link_param param; 329 struct cfctrl_link_param param;
337 int ret; 330 int ret;
338 ret = connect_req_to_link_param(get_caif_conf(), conn_req, &param); 331
332 ret = caif_connect_req_to_link_param(cfg, conn_req, &param);
339 if (ret) 333 if (ret)
340 return ret; 334 return ret;
341 /* Hook up the adaptation layer. */ 335 /* Hook up the adaptation layer. */
342 return cfcnfg_add_adaptation_layer(get_caif_conf(), &param, 336 return cfcnfg_add_adaptation_layer(cfg, &param,
343 client_layer, ifindex, 337 client_layer, ifindex,
344 headroom, tailroom); 338 headroom, tailroom);
345} 339}
@@ -347,16 +341,10 @@ EXPORT_SYMBOL(caif_connect_client);
347 341
348int caif_disconnect_client(struct cflayer *adap_layer) 342int caif_disconnect_client(struct cflayer *adap_layer)
349{ 343{
350 return cfcnfg_disconn_adapt_layer(get_caif_conf(), adap_layer); 344 return cfcnfg_disconn_adapt_layer(cfg, adap_layer);
351} 345}
352EXPORT_SYMBOL(caif_disconnect_client); 346EXPORT_SYMBOL(caif_disconnect_client);
353 347
354void caif_release_client(struct cflayer *adap_layer)
355{
356 cfcnfg_release_adap_layer(adap_layer);
357}
358EXPORT_SYMBOL(caif_release_client);
359
360/* Per-namespace Caif devices handling */ 348/* Per-namespace Caif devices handling */
361static int caif_init_net(struct net *net) 349static int caif_init_net(struct net *net)
362{ 350{