diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-04-11 06:43:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-11 18:08:47 -0400 |
commit | 73d6ac633c6c0ca703f90db0b808d9593e46aef6 (patch) | |
tree | 738fb16f97e24288f9db9c6b43b4bcee4f794dc6 /net/caif/caif_dev.c | |
parent | 1c01a80cfec6f806246f31ff2680cd3639b30e67 (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.c | 24 |
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 | |||
326 | struct cfcnfg *get_caif_conf(void) | ||
327 | { | ||
328 | return cfg; | ||
329 | } | ||
330 | EXPORT_SYMBOL(get_caif_conf); | ||
331 | |||
332 | int caif_connect_client(struct caif_connect_request *conn_req, | 325 | int 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, ¶m); | 331 | |
332 | ret = caif_connect_req_to_link_param(cfg, conn_req, ¶m); | ||
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(), ¶m, | 336 | return cfcnfg_add_adaptation_layer(cfg, ¶m, |
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 | ||
348 | int caif_disconnect_client(struct cflayer *adap_layer) | 342 | int 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 | } |
352 | EXPORT_SYMBOL(caif_disconnect_client); | 346 | EXPORT_SYMBOL(caif_disconnect_client); |
353 | 347 | ||
354 | void caif_release_client(struct cflayer *adap_layer) | ||
355 | { | ||
356 | cfcnfg_release_adap_layer(adap_layer); | ||
357 | } | ||
358 | EXPORT_SYMBOL(caif_release_client); | ||
359 | |||
360 | /* Per-namespace Caif devices handling */ | 348 | /* Per-namespace Caif devices handling */ |
361 | static int caif_init_net(struct net *net) | 349 | static int caif_init_net(struct net *net) |
362 | { | 350 | { |