kernel: define RB_ID_HW_OPTIONS in include/linux/routerboot.h
[openwrt.git] / target / linux / generic / patches-3.10 / 026-bcma-export-bcma_find_core_unit.patch
1 From 0fc9d696e4855f1e03910c431499d68e75904929 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 10 Nov 2013 20:43:46 +0100
4 Subject: [PATCH] bcma: export bcma_find_core_unit()
5
6 ---
7  drivers/bcma/bcma_private.h |    2 --
8  drivers/bcma/main.c         |   13 +------------
9  include/linux/bcma/bcma.h   |    9 ++++++++-
10  3 files changed, 9 insertions(+), 15 deletions(-)
11
12 --- a/drivers/bcma/bcma_private.h
13 +++ b/drivers/bcma/bcma_private.h
14 @@ -33,8 +33,6 @@ int __init bcma_bus_early_register(struc
15  int bcma_bus_suspend(struct bcma_bus *bus);
16  int bcma_bus_resume(struct bcma_bus *bus);
17  #endif
18 -struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
19 -                                       u8 unit);
20  
21  /* scan.c */
22  int bcma_bus_scan(struct bcma_bus *bus);
23 --- a/drivers/bcma/main.c
24 +++ b/drivers/bcma/main.c
25 @@ -69,18 +69,6 @@ static u16 bcma_cc_core_id(struct bcma_b
26         return BCMA_CORE_CHIPCOMMON;
27  }
28  
29 -struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
30 -{
31 -       struct bcma_device *core;
32 -
33 -       list_for_each_entry(core, &bus->cores, list) {
34 -               if (core->id.id == coreid)
35 -                       return core;
36 -       }
37 -       return NULL;
38 -}
39 -EXPORT_SYMBOL_GPL(bcma_find_core);
40 -
41  struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
42                                         u8 unit)
43  {
44 @@ -92,6 +80,7 @@ struct bcma_device *bcma_find_core_unit(
45         }
46         return NULL;
47  }
48 +EXPORT_SYMBOL_GPL(bcma_find_core_unit);
49  
50  bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
51                      int timeout)
52 --- a/include/linux/bcma/bcma.h
53 +++ b/include/linux/bcma/bcma.h
54 @@ -418,7 +418,14 @@ static inline void bcma_maskset16(struct
55         bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set);
56  }
57  
58 -extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid);
59 +extern struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
60 +                                              u8 unit);
61 +static inline struct bcma_device *bcma_find_core(struct bcma_bus *bus,
62 +                                                u16 coreid)
63 +{
64 +       return bcma_find_core_unit(bus, coreid, 0);
65 +}
66 +
67  extern bool bcma_core_is_enabled(struct bcma_device *core);
68  extern void bcma_core_disable(struct bcma_device *core, u32 flags);
69  extern int bcma_core_enable(struct bcma_device *core, u32 flags);