linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.12 1/2] bcma: use helper function to set core dev's parent
@ 2017-03-03 10:34 Rafał Miłecki
  2017-03-03 10:34 ` [PATCH 4.12 2/2] bcma: fill core OF info independently of bus type Rafał Miłecki
  2017-03-20 17:12 ` [4.12,1/2] bcma: use helper function to set core dev's parent Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Rafał Miłecki @ 2017-03-03 10:34 UTC (permalink / raw)
  To: Kalle Valo, linux-wireless; +Cc: Hauke Mehrtens, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

A tiny code deduplication thanks to the bcma_bus_get_host_dev.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/bcma/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 12da68ec48ba..4f88821c1b2a 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -242,17 +242,16 @@ void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
 	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);
+	core->dev.parent = bcma_bus_get_host_dev(bus);
 
 	switch (bus->hosttype) {
 	case BCMA_HOSTTYPE_PCI:
-		core->dev.parent = &bus->host_pci->dev;
 		core->dma_dev = &bus->host_pci->dev;
 		core->irq = bus->host_pci->irq;
 		break;
 	case BCMA_HOSTTYPE_SOC:
 		if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) {
 			core->dma_dev = &bus->host_pdev->dev;
-			core->dev.parent = &bus->host_pdev->dev;
 			if (core->dev.parent)
 				bcma_of_fill_device(core->dev.parent, core);
 		} else {
-- 
2.11.0

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

* [PATCH 4.12 2/2] bcma: fill core OF info independently of bus type
  2017-03-03 10:34 [PATCH 4.12 1/2] bcma: use helper function to set core dev's parent Rafał Miłecki
@ 2017-03-03 10:34 ` Rafał Miłecki
  2017-03-20 17:12 ` [4.12,1/2] bcma: use helper function to set core dev's parent Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2017-03-03 10:34 UTC (permalink / raw)
  To: Kalle Valo, linux-wireless; +Cc: Hauke Mehrtens, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

PCI devices can be described in DT as well so we should always execute
relevant code. This will make bcma e.g. set of_node for cores described
in DT.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/bcma/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 4f88821c1b2a..2da7fe1d20a7 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -243,6 +243,8 @@ void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
 	core->dev.bus = &bcma_bus_type;
 	dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
 	core->dev.parent = bcma_bus_get_host_dev(bus);
+	if (core->dev.parent)
+		bcma_of_fill_device(core->dev.parent, core);
 
 	switch (bus->hosttype) {
 	case BCMA_HOSTTYPE_PCI:
@@ -252,8 +254,6 @@ void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
 	case BCMA_HOSTTYPE_SOC:
 		if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) {
 			core->dma_dev = &bus->host_pdev->dev;
-			if (core->dev.parent)
-				bcma_of_fill_device(core->dev.parent, core);
 		} else {
 			core->dev.dma_mask = &core->dev.coherent_dma_mask;
 			core->dma_dev = &core->dev;
-- 
2.11.0

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

* Re: [4.12,1/2] bcma: use helper function to set core dev's parent
  2017-03-03 10:34 [PATCH 4.12 1/2] bcma: use helper function to set core dev's parent Rafał Miłecki
  2017-03-03 10:34 ` [PATCH 4.12 2/2] bcma: fill core OF info independently of bus type Rafał Miłecki
@ 2017-03-20 17:12 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2017-03-20 17:12 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-wireless, Hauke Mehrtens, Rafał Miłecki

Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> A tiny code deduplication thanks to the bcma_bus_get_host_dev.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

2 patches applied to wireless-drivers-next.git, thanks.

5e48a4cd2ee9 bcma: use helper function to set core dev's parent
f825f6ed20e3 bcma: fill core OF info independently of bus type

-- 
https://patchwork.kernel.org/patch/9602507/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2017-03-20 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03 10:34 [PATCH 4.12 1/2] bcma: use helper function to set core dev's parent Rafał Miłecki
2017-03-03 10:34 ` [PATCH 4.12 2/2] bcma: fill core OF info independently of bus type Rafał Miłecki
2017-03-20 17:12 ` [4.12,1/2] bcma: use helper function to set core dev's parent Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).