2016-11-23 13:40:09

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v4 0/2] da8xx: fix section mismatch in new drivers

Sekhar noticed there's a section mismatch in the da8xx-mstpri and
da8xx-ddrctl drivers. This is caused by calling
of_flat_dt_get_machine_name() which has an __init annotation.

This series makes the drivers drop the call and not print the
machine name in the error message.

v1 -> v2:
- drop patch [1/3] from v1
- introduce internal routines in the drivers instead of a general
function in of/base.c

v2 -> v3:
- use of_property_read_string_index() instead of
of_property_read_string() to get the first compatible entry
- s/priotities/priorities

v3 -> v4:
- drop the compatible string printing altogether as the new function
is not safe
- merge the typo fix into patch [1/2]

Bartosz Golaszewski (2):
bus: da8xx-mstpri: drop the call to of_flat_dt_get_machine_name()
memory: da8xx-ddrctl: drop the call to of_flat_dt_get_machine_name()

drivers/bus/da8xx-mstpri.c | 4 +---
drivers/memory/da8xx-ddrctl.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)

--
2.9.3


2016-11-23 13:40:11

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v4 1/2] bus: da8xx-mstpri: drop the call to of_flat_dt_get_machine_name()

In order to avoid a section mismatch drop the call to
of_flat_dt_get_machine_name() when printing the error message.

While we're at it: fix a typo.

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
drivers/bus/da8xx-mstpri.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/da8xx-mstpri.c b/drivers/bus/da8xx-mstpri.c
index 85f0b53..063397f 100644
--- a/drivers/bus/da8xx-mstpri.c
+++ b/drivers/bus/da8xx-mstpri.c
@@ -16,7 +16,6 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/regmap.h>
-#include <linux/of_fdt.h>

/*
* REVISIT: Linux doesn't have a good framework for the kind of performance
@@ -226,8 +225,7 @@ static int da8xx_mstpri_probe(struct platform_device *pdev)

prio_list = da8xx_mstpri_get_board_prio();
if (!prio_list) {
- dev_err(dev, "no master priotities defined for board '%s'\n",
- of_flat_dt_get_machine_name());
+ dev_err(dev, "no master priorities defined for this board\n");
return -EINVAL;
}

--
2.9.3

2016-11-23 13:40:32

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v4 2/2] memory: da8xx-ddrctl: drop the call to of_flat_dt_get_machine_name()

In order to avoid a section mismatch drop the call to
of_flat_dt_get_machine_name() when printing the error message.

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
drivers/memory/da8xx-ddrctl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/memory/da8xx-ddrctl.c b/drivers/memory/da8xx-ddrctl.c
index a20e7bb..030afbe 100644
--- a/drivers/memory/da8xx-ddrctl.c
+++ b/drivers/memory/da8xx-ddrctl.c
@@ -14,7 +14,6 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
-#include <linux/of_fdt.h>
#include <linux/platform_device.h>
#include <linux/io.h>

@@ -117,8 +116,7 @@ static int da8xx_ddrctl_probe(struct platform_device *pdev)

setting = da8xx_ddrctl_get_board_settings();
if (!setting) {
- dev_err(dev, "no settings for board '%s'\n",
- of_flat_dt_get_machine_name());
+ dev_err(dev, "no settings defined for this board\n");
return -EINVAL;
}

--
2.9.3

2016-11-24 06:02:02

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v4 0/2] da8xx: fix section mismatch in new drivers

On Wednesday 23 November 2016 07:09 PM, Bartosz Golaszewski wrote:
> Sekhar noticed there's a section mismatch in the da8xx-mstpri and
> da8xx-ddrctl drivers. This is caused by calling
> of_flat_dt_get_machine_name() which has an __init annotation.
>
> This series makes the drivers drop the call and not print the
> machine name in the error message.

Applied both. Thanks!

Regards,
Sekhar