linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: stmpe: Revert "Constify static struct resource"
@ 2021-03-02 23:47 Rikard Falkeborn
  2021-03-03  8:15 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2021-03-02 23:47 UTC (permalink / raw)
  To: Lee Jones
  Cc: Maxime Coquelin, Alexandre Torgue, linux-stm32, linux-arm-kernel,
	linux-kernel, Rikard Falkeborn, Andy Shevchenko

Andy noted that constification of some static resource structs in
intel_quark_i2c_gpio.c were incorrect. It turns out there is another
change from the same series that is also incorrect in stmpe.c.
These structures are modified at init and can not be made const.

This reverts commit 8d7b3a6dac4eae22c58b0853696cbd256966741b.

Fixes: 8d7b3a6dac4e ("mfd: stmpe: Constify static struct resource")
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
I went through the series and this was the only additional issue I
found. Sorry about that.

 drivers/mfd/stmpe.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 90f3292230c9..1aee3b3253fc 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(stmpe_set_altfunc);
  * GPIO (all variants)
  */
 
-static const struct resource stmpe_gpio_resources[] = {
+static struct resource stmpe_gpio_resources[] = {
 	/* Start and end filled dynamically */
 	{
 		.flags	= IORESOURCE_IRQ,
@@ -336,7 +336,7 @@ static const struct mfd_cell stmpe_gpio_cell_noirq = {
  * Keypad (1601, 2401, 2403)
  */
 
-static const struct resource stmpe_keypad_resources[] = {
+static struct resource stmpe_keypad_resources[] = {
 	{
 		.name	= "KEYPAD",
 		.flags	= IORESOURCE_IRQ,
@@ -357,7 +357,7 @@ static const struct mfd_cell stmpe_keypad_cell = {
 /*
  * PWM (1601, 2401, 2403)
  */
-static const struct resource stmpe_pwm_resources[] = {
+static struct resource stmpe_pwm_resources[] = {
 	{
 		.name	= "PWM0",
 		.flags	= IORESOURCE_IRQ,
@@ -445,7 +445,7 @@ static struct stmpe_variant_info stmpe801_noirq = {
  * Touchscreen (STMPE811 or STMPE610)
  */
 
-static const struct resource stmpe_ts_resources[] = {
+static struct resource stmpe_ts_resources[] = {
 	{
 		.name	= "TOUCH_DET",
 		.flags	= IORESOURCE_IRQ,
@@ -467,7 +467,7 @@ static const struct mfd_cell stmpe_ts_cell = {
  * ADC (STMPE811)
  */
 
-static const struct resource stmpe_adc_resources[] = {
+static struct resource stmpe_adc_resources[] = {
 	{
 		.name	= "STMPE_TEMP_SENS",
 		.flags	= IORESOURCE_IRQ,
-- 
2.30.1


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

* Re: [PATCH] mfd: stmpe: Revert "Constify static struct resource"
  2021-03-02 23:47 [PATCH] mfd: stmpe: Revert "Constify static struct resource" Rikard Falkeborn
@ 2021-03-03  8:15 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2021-03-03  8:15 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Lee Jones, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	linux-arm-kernel, linux-kernel

On Wed, Mar 03, 2021 at 12:47:10AM +0100, Rikard Falkeborn wrote:
> Andy noted that constification of some static resource structs in

(If you wish, you may use Reported-by:, I'm fine with either way)

> intel_quark_i2c_gpio.c were incorrect. It turns out there is another
> change from the same series that is also incorrect in stmpe.c.
> These structures are modified at init and can not be made const.
> 
> This reverts commit 8d7b3a6dac4eae22c58b0853696cbd256966741b.

I recommend to add a comment in the code as I did so nobody (okay, who reads
the comments) will change that again.

Thanks!

> Fixes: 8d7b3a6dac4e ("mfd: stmpe: Constify static struct resource")
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> I went through the series and this was the only additional issue I
> found. Sorry about that.
> 
>  drivers/mfd/stmpe.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index 90f3292230c9..1aee3b3253fc 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(stmpe_set_altfunc);
>   * GPIO (all variants)
>   */
>  
> -static const struct resource stmpe_gpio_resources[] = {
> +static struct resource stmpe_gpio_resources[] = {
>  	/* Start and end filled dynamically */
>  	{
>  		.flags	= IORESOURCE_IRQ,
> @@ -336,7 +336,7 @@ static const struct mfd_cell stmpe_gpio_cell_noirq = {
>   * Keypad (1601, 2401, 2403)
>   */
>  
> -static const struct resource stmpe_keypad_resources[] = {
> +static struct resource stmpe_keypad_resources[] = {
>  	{
>  		.name	= "KEYPAD",
>  		.flags	= IORESOURCE_IRQ,
> @@ -357,7 +357,7 @@ static const struct mfd_cell stmpe_keypad_cell = {
>  /*
>   * PWM (1601, 2401, 2403)
>   */
> -static const struct resource stmpe_pwm_resources[] = {
> +static struct resource stmpe_pwm_resources[] = {
>  	{
>  		.name	= "PWM0",
>  		.flags	= IORESOURCE_IRQ,
> @@ -445,7 +445,7 @@ static struct stmpe_variant_info stmpe801_noirq = {
>   * Touchscreen (STMPE811 or STMPE610)
>   */
>  
> -static const struct resource stmpe_ts_resources[] = {
> +static struct resource stmpe_ts_resources[] = {
>  	{
>  		.name	= "TOUCH_DET",
>  		.flags	= IORESOURCE_IRQ,
> @@ -467,7 +467,7 @@ static const struct mfd_cell stmpe_ts_cell = {
>   * ADC (STMPE811)
>   */
>  
> -static const struct resource stmpe_adc_resources[] = {
> +static struct resource stmpe_adc_resources[] = {
>  	{
>  		.name	= "STMPE_TEMP_SENS",
>  		.flags	= IORESOURCE_IRQ,
> -- 
> 2.30.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2021-03-03 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 23:47 [PATCH] mfd: stmpe: Revert "Constify static struct resource" Rikard Falkeborn
2021-03-03  8:15 ` Andy Shevchenko

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).