From: Lee Jones <lee.jones@linaro.org>
To: Nicolae Rosia <Nicolae_Rosia@mentor.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, Baruch Siach <baruch@tkos.co.il>,
Tony Lindgren <tony@atomide.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
linux-kernel@vger.kernel.org,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Mark Brown <broonie@kernel.org>,
Graeme Gregory <gg@slimlogic.co.uk>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/5] mfd: twl: move structure definitions to a public header
Date: Tue, 3 Jan 2017 15:40:51 +0000 [thread overview]
Message-ID: <20170103154051.GI2977@dell> (raw)
In-Reply-To: <20161126181326.14951-4-Nicolae_Rosia@mentor.com>
On Sat, 26 Nov 2016, Nicolae Rosia wrote:
> We want to get rid of exported symbols and have
> the child devices use structure members directly.
> Move the structure definitions to header and set
> drvdata so child devices can access it.
< Please use all 75 chars allocated to the commitlog before line wrapping >
> Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> ---
> drivers/mfd/twl-core.c | 27 ++++-----------------------
> include/linux/mfd/twl-core.h | 35 +++++++++++++++++++++++++++++++++++
> 2 files changed, 39 insertions(+), 23 deletions(-)
> create mode 100644 include/linux/mfd/twl-core.h
>
> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index e16084e..409b836 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -48,6 +48,7 @@
>
> #include <linux/i2c.h>
> #include <linux/i2c/twl.h>
> +#include <linux/mfd/twl-core.h>
>
> /* Register descriptions for audio */
> #include <linux/mfd/twl4030-audio.h>
> @@ -154,28 +155,7 @@ int twl4030_init_irq(struct device *dev, int irq_num);
> int twl4030_exit_irq(void);
> int twl4030_init_chip_irq(const char *chip);
>
> -/* Structure for each TWL4030/TWL6030 Slave */
> -struct twl_client {
> - struct i2c_client *client;
> - struct regmap *regmap;
> -};
> -
> -/* mapping the module id to slave id and base address */
> -struct twl_mapping {
> - unsigned char sid; /* Slave ID */
> - unsigned char base; /* base address */
> -};
> -
> -struct twl_private {
> - bool ready; /* The core driver is ready to be used */
> - u32 twl_idcode; /* TWL IDCODE Register value */
> - unsigned int twl_id;
> -
> - struct twl_mapping *twl_map;
> - struct twl_client *twl_modules;
> -};
> -
> -static struct twl_private *twl_priv;
> +static struct twlcore *twl_priv;
I'm guessing when you remove the exported functions, you can remove this?
> static struct twl_mapping twl4030_map[] = {
> /*
> @@ -745,7 +725,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> goto free;
> }
>
> - twl_priv = devm_kzalloc(&client->dev, sizeof(struct twl_private),
> + twl_priv = devm_kzalloc(&client->dev, sizeof(struct twlcore),
> GFP_KERNEL);
> if (!twl_priv) {
> status = -ENOMEM;
> @@ -803,6 +783,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> }
>
> twl_priv->ready = true;
> + dev_set_drvdata(&client->dev, twl_priv);
>
> /* setup clock framework */
> clocks_init(&pdev->dev);
> diff --git a/include/linux/mfd/twl-core.h b/include/linux/mfd/twl-core.h
> new file mode 100644
> index 0000000..d1c01b3
> --- /dev/null
> +++ b/include/linux/mfd/twl-core.h
> @@ -0,0 +1,35 @@
> +/*
> + * MFD core driver for the Texas Instruments TWL PMIC family
> + *
> + * Copyright (C) 2016 Nicolae Rosia <nicolae.rosia@gmail.com>
Your sign-off and SoB are different? Why?
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __TWL_CORE_H__
> +#define __TWL_CORE_H__
_MFD_
> +/* Structure for each TWL4030/TWL6030 Slave */
> +struct twl_client {
> + struct i2c_client *client;
> + struct regmap *regmap;
> +};
> +
> +/* mapping the module id to slave id and base address */
> +struct twl_mapping {
> + unsigned char sid; /* Slave ID */
> + unsigned char base; /* base address */
> +};
> +
> +struct twlcore {
> + bool ready; /* The core driver is ready to be used */
> + u32 twl_idcode; /* TWL IDCODE Register value */
> + unsigned int twl_id;
> +
> + struct twl_mapping *twl_map;
> + struct twl_client *twl_modules;
> +};
> +
> +#endif
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] mfd: twl: move structure definitions to a public header
Date: Tue, 3 Jan 2017 15:40:51 +0000 [thread overview]
Message-ID: <20170103154051.GI2977@dell> (raw)
In-Reply-To: <20161126181326.14951-4-Nicolae_Rosia@mentor.com>
On Sat, 26 Nov 2016, Nicolae Rosia wrote:
> We want to get rid of exported symbols and have
> the child devices use structure members directly.
> Move the structure definitions to header and set
> drvdata so child devices can access it.
< Please use all 75 chars allocated to the commitlog before line wrapping >
> Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> ---
> drivers/mfd/twl-core.c | 27 ++++-----------------------
> include/linux/mfd/twl-core.h | 35 +++++++++++++++++++++++++++++++++++
> 2 files changed, 39 insertions(+), 23 deletions(-)
> create mode 100644 include/linux/mfd/twl-core.h
>
> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index e16084e..409b836 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -48,6 +48,7 @@
>
> #include <linux/i2c.h>
> #include <linux/i2c/twl.h>
> +#include <linux/mfd/twl-core.h>
>
> /* Register descriptions for audio */
> #include <linux/mfd/twl4030-audio.h>
> @@ -154,28 +155,7 @@ int twl4030_init_irq(struct device *dev, int irq_num);
> int twl4030_exit_irq(void);
> int twl4030_init_chip_irq(const char *chip);
>
> -/* Structure for each TWL4030/TWL6030 Slave */
> -struct twl_client {
> - struct i2c_client *client;
> - struct regmap *regmap;
> -};
> -
> -/* mapping the module id to slave id and base address */
> -struct twl_mapping {
> - unsigned char sid; /* Slave ID */
> - unsigned char base; /* base address */
> -};
> -
> -struct twl_private {
> - bool ready; /* The core driver is ready to be used */
> - u32 twl_idcode; /* TWL IDCODE Register value */
> - unsigned int twl_id;
> -
> - struct twl_mapping *twl_map;
> - struct twl_client *twl_modules;
> -};
> -
> -static struct twl_private *twl_priv;
> +static struct twlcore *twl_priv;
I'm guessing when you remove the exported functions, you can remove this?
> static struct twl_mapping twl4030_map[] = {
> /*
> @@ -745,7 +725,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> goto free;
> }
>
> - twl_priv = devm_kzalloc(&client->dev, sizeof(struct twl_private),
> + twl_priv = devm_kzalloc(&client->dev, sizeof(struct twlcore),
> GFP_KERNEL);
> if (!twl_priv) {
> status = -ENOMEM;
> @@ -803,6 +783,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> }
>
> twl_priv->ready = true;
> + dev_set_drvdata(&client->dev, twl_priv);
>
> /* setup clock framework */
> clocks_init(&pdev->dev);
> diff --git a/include/linux/mfd/twl-core.h b/include/linux/mfd/twl-core.h
> new file mode 100644
> index 0000000..d1c01b3
> --- /dev/null
> +++ b/include/linux/mfd/twl-core.h
> @@ -0,0 +1,35 @@
> +/*
> + * MFD core driver for the Texas Instruments TWL PMIC family
> + *
> + * Copyright (C) 2016 Nicolae Rosia <nicolae.rosia@gmail.com>
Your sign-off and SoB are different? Why?
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __TWL_CORE_H__
> +#define __TWL_CORE_H__
_MFD_
> +/* Structure for each TWL4030/TWL6030 Slave */
> +struct twl_client {
> + struct i2c_client *client;
> + struct regmap *regmap;
> +};
> +
> +/* mapping the module id to slave id and base address */
> +struct twl_mapping {
> + unsigned char sid; /* Slave ID */
> + unsigned char base; /* base address */
> +};
> +
> +struct twlcore {
> + bool ready; /* The core driver is ready to be used */
> + u32 twl_idcode; /* TWL IDCODE Register value */
> + unsigned int twl_id;
> +
> + struct twl_mapping *twl_map;
> + struct twl_client *twl_modules;
> +};
> +
> +#endif
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Nicolae Rosia <Nicolae_Rosia@mentor.com>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Tony Lindgren <tony@atomide.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Graeme Gregory <gg@slimlogic.co.uk>,
Baruch Siach <baruch@tkos.co.il>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 3/5] mfd: twl: move structure definitions to a public header
Date: Tue, 3 Jan 2017 15:40:51 +0000 [thread overview]
Message-ID: <20170103154051.GI2977@dell> (raw)
In-Reply-To: <20161126181326.14951-4-Nicolae_Rosia@mentor.com>
On Sat, 26 Nov 2016, Nicolae Rosia wrote:
> We want to get rid of exported symbols and have
> the child devices use structure members directly.
> Move the structure definitions to header and set
> drvdata so child devices can access it.
< Please use all 75 chars allocated to the commitlog before line wrapping >
> Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> ---
> drivers/mfd/twl-core.c | 27 ++++-----------------------
> include/linux/mfd/twl-core.h | 35 +++++++++++++++++++++++++++++++++++
> 2 files changed, 39 insertions(+), 23 deletions(-)
> create mode 100644 include/linux/mfd/twl-core.h
>
> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index e16084e..409b836 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -48,6 +48,7 @@
>
> #include <linux/i2c.h>
> #include <linux/i2c/twl.h>
> +#include <linux/mfd/twl-core.h>
>
> /* Register descriptions for audio */
> #include <linux/mfd/twl4030-audio.h>
> @@ -154,28 +155,7 @@ int twl4030_init_irq(struct device *dev, int irq_num);
> int twl4030_exit_irq(void);
> int twl4030_init_chip_irq(const char *chip);
>
> -/* Structure for each TWL4030/TWL6030 Slave */
> -struct twl_client {
> - struct i2c_client *client;
> - struct regmap *regmap;
> -};
> -
> -/* mapping the module id to slave id and base address */
> -struct twl_mapping {
> - unsigned char sid; /* Slave ID */
> - unsigned char base; /* base address */
> -};
> -
> -struct twl_private {
> - bool ready; /* The core driver is ready to be used */
> - u32 twl_idcode; /* TWL IDCODE Register value */
> - unsigned int twl_id;
> -
> - struct twl_mapping *twl_map;
> - struct twl_client *twl_modules;
> -};
> -
> -static struct twl_private *twl_priv;
> +static struct twlcore *twl_priv;
I'm guessing when you remove the exported functions, you can remove this?
> static struct twl_mapping twl4030_map[] = {
> /*
> @@ -745,7 +725,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> goto free;
> }
>
> - twl_priv = devm_kzalloc(&client->dev, sizeof(struct twl_private),
> + twl_priv = devm_kzalloc(&client->dev, sizeof(struct twlcore),
> GFP_KERNEL);
> if (!twl_priv) {
> status = -ENOMEM;
> @@ -803,6 +783,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> }
>
> twl_priv->ready = true;
> + dev_set_drvdata(&client->dev, twl_priv);
>
> /* setup clock framework */
> clocks_init(&pdev->dev);
> diff --git a/include/linux/mfd/twl-core.h b/include/linux/mfd/twl-core.h
> new file mode 100644
> index 0000000..d1c01b3
> --- /dev/null
> +++ b/include/linux/mfd/twl-core.h
> @@ -0,0 +1,35 @@
> +/*
> + * MFD core driver for the Texas Instruments TWL PMIC family
> + *
> + * Copyright (C) 2016 Nicolae Rosia <nicolae.rosia@gmail.com>
Your sign-off and SoB are different? Why?
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __TWL_CORE_H__
> +#define __TWL_CORE_H__
_MFD_
> +/* Structure for each TWL4030/TWL6030 Slave */
> +struct twl_client {
> + struct i2c_client *client;
> + struct regmap *regmap;
> +};
> +
> +/* mapping the module id to slave id and base address */
> +struct twl_mapping {
> + unsigned char sid; /* Slave ID */
> + unsigned char base; /* base address */
> +};
> +
> +struct twlcore {
> + bool ready; /* The core driver is ready to be used */
> + u32 twl_idcode; /* TWL IDCODE Register value */
> + unsigned int twl_id;
> +
> + struct twl_mapping *twl_map;
> + struct twl_client *twl_modules;
> +};
> +
> +#endif
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2017-01-03 15:40 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-26 18:13 [PATCH 0/5] mfd: twl: improvements and new regulator driver Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2016-11-26 18:13 ` [PATCH 1/5] mfd: twl-core: make driver DT only Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2017-01-03 15:00 ` Lee Jones
2017-01-03 15:00 ` Lee Jones
2017-01-03 15:00 ` Lee Jones
[not found] ` <20161126181326.14951-1-Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2016-11-26 18:13 ` [PATCH 2/5] mfd: twl: remove useless header Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2017-01-03 15:30 ` Lee Jones
2017-01-03 15:30 ` Lee Jones
2017-01-03 15:30 ` Lee Jones
2016-11-26 18:13 ` [PATCH 3/5] mfd: twl: move structure definitions to a public header Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2017-01-03 15:40 ` Lee Jones [this message]
2017-01-03 15:40 ` Lee Jones
2017-01-03 15:40 ` Lee Jones
2016-11-26 18:13 ` [PATCH 4/5] regulator: Add support for TI TWL6032 Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
[not found] ` <20161126181326.14951-5-Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2016-11-26 18:55 ` kbuild test robot
2016-11-26 18:55 ` kbuild test robot
2016-11-26 18:55 ` kbuild test robot
2016-11-26 20:24 ` Rosia, Nicolae
2016-11-26 20:24 ` Rosia, Nicolae
2016-12-01 16:10 ` Rob Herring
2016-12-01 16:10 ` Rob Herring
2016-11-26 18:13 ` [PATCH 5/5] mfd: twl: use mfd_add_devices for TWL6032 regulator Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2016-11-26 18:13 ` Nicolae Rosia
2017-01-03 15:46 ` Lee Jones
2017-01-03 15:46 ` Lee Jones
2017-01-03 15:46 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170103154051.GI2977@dell \
--to=lee.jones@linaro.org \
--cc=Nicolae_Rosia@mentor.com \
--cc=baruch@tkos.co.il \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gg@slimlogic.co.uk \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=paul.gortmaker@windriver.com \
--cc=robh+dt@kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.