Patchwork [PATCHv4,3/9] ARM: orion: pass the i2c registers definition through the platform data

login
register
mail settings
Submitter Maxime Ripard
Date June 12, 2013, 8:07 a.m.
Message ID <1371024438-16631-4-git-send-email-maxime.ripard@free-electrons.com>
Download mbox | patch
Permalink /patch/250691/
State Superseded
Headers show

Comments

Maxime Ripard - June 12, 2013, 8:07 a.m.
Convert the existing platform data users of the MV64XXX i2c driver to
pass the registers offset structure along with the platform data.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/plat-orion/common.c | 2 ++
 1 file changed, 2 insertions(+)
Tomasz Figa - June 12, 2013, 8:39 a.m.
Hi Maxime,

On Wednesday 12 of June 2013 10:07:12 Maxime Ripard wrote:
> Convert the existing platform data users of the MV64XXX i2c driver to
> pass the registers offset structure along with the platform data.

I'm not really convinced that platform data is the right way to pass such 
data.

IMHO driver/match data were supposed to contain variant-specific 
parameters, which the driver would receive based on matching platform 
device name (in non-DT case) or compatible string (in DT case).

Best regards,
Tomasz

> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  arch/arm/plat-orion/common.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index c019b7a..c166fc9 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -509,6 +509,7 @@ void __init orion_ge00_switch_init(struct
> dsa_platform_data *d, int irq)
> ***********************************************************************
> *****/ static struct mv64xxx_i2c_pdata orion_i2c_pdata = {
>  	.freq_n		= 3,
> +	.regs		= &mv64xxx_i2c_regs_mv64xxx,
>  	.timeout	= 1000, /* Default timeout of 1 second */
>  };
> 
> @@ -524,6 +525,7 @@ static struct platform_device orion_i2c = {
> 
>  static struct mv64xxx_i2c_pdata orion_i2c_1_pdata = {
>  	.freq_n		= 3,
> +	.regs		= &mv64xxx_i2c_regs_mv64xxx,
>  	.timeout	= 1000, /* Default timeout of 1 second */
>  };
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index c019b7a..c166fc9 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -509,6 +509,7 @@  void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq)
  ****************************************************************************/
 static struct mv64xxx_i2c_pdata orion_i2c_pdata = {
 	.freq_n		= 3,
+	.regs		= &mv64xxx_i2c_regs_mv64xxx,
 	.timeout	= 1000, /* Default timeout of 1 second */
 };
 
@@ -524,6 +525,7 @@  static struct platform_device orion_i2c = {
 
 static struct mv64xxx_i2c_pdata orion_i2c_1_pdata = {
 	.freq_n		= 3,
+	.regs		= &mv64xxx_i2c_regs_mv64xxx,
 	.timeout	= 1000, /* Default timeout of 1 second */
 };