All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] bcma: fill core details for every device
@ 2014-10-02 10:38 Rafał Miłecki
  2014-10-03 14:41 ` Hauke Mehrtens
  2014-10-03 15:00 ` [PATCH] " Rafał Miłecki
  0 siblings, 2 replies; 3+ messages in thread
From: Rafał Miłecki @ 2014-10-02 10:38 UTC (permalink / raw)
  To: linux-wireless; +Cc: Hauke Mehrtens, Rafał Miłecki

We were setting things like dma_dev, IRQ, etc. during core registration
only. We need such info for cores handled internally (e.g. ChipCommon)
as well.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/bcma/bcma_private.h | 1 +
 drivers/bcma/main.c         | 9 ++++++---
 drivers/bcma/scan.c         | 1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index b6412b2..314ae40 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -24,6 +24,7 @@ struct bcma_bus;
 /* main.c */
 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
 		     int timeout);
+void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
 int bcma_bus_register(struct bcma_bus *bus);
 void bcma_bus_unregister(struct bcma_bus *bus);
 int __init bcma_bus_early_register(struct bcma_bus *bus,
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 5e7a3d4..70d0f23 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -172,10 +172,8 @@ static void bcma_of_fill_device(struct platform_device *parent,
 }
 #endif /* CONFIG_OF */
 
-static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
+void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
 {
-	int err;
-
 	core->dev.release = bcma_release_core_dev;
 	core->dev.bus = &bcma_bus_type;
 	dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
@@ -199,6 +197,11 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
 	case BCMA_HOSTTYPE_SDIO:
 		break;
 	}
+}
+
+static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
+{
+	int err;
 
 	err = device_register(&core->dev);
 	if (err) {
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 14b5656..9175207 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -505,6 +505,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
 		bus->nr_cores++;
 		other_core = bcma_find_core_reverse(bus, core->id.id);
 		core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
+		bcma_prepare_core(bus, core);
 
 		bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
 			  core->core_index, bcma_device_name(&core->id),
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][RFC] bcma: fill core details for every device
  2014-10-02 10:38 [PATCH][RFC] bcma: fill core details for every device Rafał Miłecki
@ 2014-10-03 14:41 ` Hauke Mehrtens
  2014-10-03 15:00 ` [PATCH] " Rafał Miłecki
  1 sibling, 0 replies; 3+ messages in thread
From: Hauke Mehrtens @ 2014-10-03 14:41 UTC (permalink / raw)
  To: Rafał Miłecki, linux-wireless

On 10/02/2014 12:38 PM, Rafał Miłecki wrote:
> We were setting things like dma_dev, IRQ, etc. during core registration
> only. We need such info for cores handled internally (e.g. ChipCommon)
> as well.
> 
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>

I already was preparing a patch doing similar things but this one looks
better.

> ---
>  drivers/bcma/bcma_private.h | 1 +
>  drivers/bcma/main.c         | 9 ++++++---
>  drivers/bcma/scan.c         | 1 +
>  3 files changed, 8 insertions(+), 3 deletions(-)
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] bcma: fill core details for every device
  2014-10-02 10:38 [PATCH][RFC] bcma: fill core details for every device Rafał Miłecki
  2014-10-03 14:41 ` Hauke Mehrtens
@ 2014-10-03 15:00 ` Rafał Miłecki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2014-10-03 15:00 UTC (permalink / raw)
  To: John W. Linville, linux-wireless; +Cc: Hauke Mehrtens, Rafał Miłecki

We were setting things like dma_dev, IRQ, etc. during core registration
only. We need such info for cores handled internally (e.g. ChipCommon)
as well.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
---
No changes since RFC. Added Hauke's ack.
---
 drivers/bcma/bcma_private.h | 1 +
 drivers/bcma/main.c         | 9 ++++++---
 drivers/bcma/scan.c         | 1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index b6412b2..314ae40 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -24,6 +24,7 @@ struct bcma_bus;
 /* main.c */
 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
 		     int timeout);
+void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
 int bcma_bus_register(struct bcma_bus *bus);
 void bcma_bus_unregister(struct bcma_bus *bus);
 int __init bcma_bus_early_register(struct bcma_bus *bus,
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index d1656c2..9b229c9 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -169,10 +169,8 @@ static void bcma_of_fill_device(struct platform_device *parent,
 }
 #endif /* CONFIG_OF */
 
-static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
+void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
 {
-	int err;
-
 	core->dev.release = bcma_release_core_dev;
 	core->dev.bus = &bcma_bus_type;
 	dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
@@ -196,6 +194,11 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
 	case BCMA_HOSTTYPE_SDIO:
 		break;
 	}
+}
+
+static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
+{
+	int err;
 
 	err = device_register(&core->dev);
 	if (err) {
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 14b5656..9175207 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -505,6 +505,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
 		bus->nr_cores++;
 		other_core = bcma_find_core_reverse(bus, core->id.id);
 		core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
+		bcma_prepare_core(bus, core);
 
 		bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
 			  core->core_index, bcma_device_name(&core->id),
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-03 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 10:38 [PATCH][RFC] bcma: fill core details for every device Rafał Miłecki
2014-10-03 14:41 ` Hauke Mehrtens
2014-10-03 15:00 ` [PATCH] " Rafał Miłecki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.