public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures
       [not found] <1268377431-11671-1-git-send-email-w.sang@pengutronix.de>
@ 2010-03-12  7:03 ` Wolfram Sang
  2010-03-12 18:34   ` Dmitry Torokhov
  2010-03-12  7:03 ` [PATCH 2/3] drivers/base: " Wolfram Sang
  2010-03-12  7:03 ` [PATCH 3/3] drivers/rtc: " Wolfram Sang
  2 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2010-03-12  7:03 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Wolfram Sang, Ralf Baechle, Eric W. Biederman, linux-mips,
	linux-kernel

Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.
Found with coccinelle, but fixed manually. Compile tested on X86 where
possible.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/mips/txx9/generic/setup.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 7174d83..95184a0 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -956,6 +956,7 @@ void __init txx9_sramc_init(struct resource *r)
 	if (!dev->base)
 		goto exit;
 	dev->dev.cls = &txx9_sramc_sysdev_class;
+	sysfs_bin_attr_init(&dev->bindata_attr);
 	dev->bindata_attr.attr.name = "bindata";
 	dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR;
 	dev->bindata_attr.read = txx9_sram_read;
-- 
1.7.0


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

* [PATCH 2/3] drivers/base: init dynamic bin_attribute structures
       [not found] <1268377431-11671-1-git-send-email-w.sang@pengutronix.de>
  2010-03-12  7:03 ` [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures Wolfram Sang
@ 2010-03-12  7:03 ` Wolfram Sang
  2010-03-13  2:11   ` Wolfram Sang
  2010-03-12  7:03 ` [PATCH 3/3] drivers/rtc: " Wolfram Sang
  2 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2010-03-12  7:03 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Wolfram Sang, Greg Kroah-Hartman, Eric W. Biederman, linux-kernel

Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.
Found with coccinelle, but fixed manually. Compile tested on X86 where
possible.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Eric W. Biederman <ebiederm@xmission.com>
---
 drivers/base/firmware_class.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index d0dc26a..443231f 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -391,6 +391,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
 
 	init_completion(&fw_priv->completion);
 	fw_priv->attr_data = firmware_attr_data_tmpl;
+	sysfs_bin_attr_init(&fw_priv->attr_data);
 	fw_priv->fw_id = kstrdup(fw_name, GFP_KERNEL);
 	if (!fw_priv->fw_id) {
 		dev_err(device, "%s: Firmware name allocation failed\n",
-- 
1.7.0


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

* [PATCH 3/3] drivers/rtc: init dynamic bin_attribute structures
       [not found] <1268377431-11671-1-git-send-email-w.sang@pengutronix.de>
  2010-03-12  7:03 ` [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures Wolfram Sang
  2010-03-12  7:03 ` [PATCH 2/3] drivers/base: " Wolfram Sang
@ 2010-03-12  7:03 ` Wolfram Sang
  2 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2010-03-12  7:03 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Wolfram Sang, Paul Gortmaker, Alessandro Zummo, Eric W. Biederman,
	rtc-linux, linux-kernel

Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.
Found with coccinelle, but fixed manually. Compile tested on X86 where
possible.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Eric W. Biederman <ebiederm@xmission.com>
---
 drivers/rtc/rtc-ds1742.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c
index a127336..cad9ceb 100644
--- a/drivers/rtc/rtc-ds1742.c
+++ b/drivers/rtc/rtc-ds1742.c
@@ -184,6 +184,7 @@ static int __devinit ds1742_rtc_probe(struct platform_device *pdev)
 	pdata->size_nvram = pdata->size - RTC_SIZE;
 	pdata->ioaddr_rtc = ioaddr + pdata->size_nvram;
 
+	sysfs_bin_attr_init(&pdata->nvram_attr);
 	pdata->nvram_attr.attr.name = "nvram";
 	pdata->nvram_attr.attr.mode = S_IRUGO | S_IWUSR;
 	pdata->nvram_attr.read = ds1742_nvram_read;
-- 
1.7.0


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

* Re: [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures
  2010-03-12  7:03 ` [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures Wolfram Sang
@ 2010-03-12 18:34   ` Dmitry Torokhov
  2010-03-13  2:28     ` Wolfram Sang
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2010-03-12 18:34 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: kernel-janitors, Ralf Baechle, Eric W. Biederman, linux-mips,
	linux-kernel

On Fri, Mar 12, 2010 at 08:03:49AM +0100, Wolfram Sang wrote:
> Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.
> Found with coccinelle, but fixed manually. Compile tested on X86 where
> possible.
> 

Regarding all 3 - it looks like these dynamically alocated attributes
could be converted to statically allocated ones. I'd recommend doing
that instead (in fact, I posted patch for the firmware_class couple days
ago).

> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Eric W. Biederman <ebiederm@xmission.com>
> ---
>  arch/mips/txx9/generic/setup.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
> index 7174d83..95184a0 100644
> --- a/arch/mips/txx9/generic/setup.c
> +++ b/arch/mips/txx9/generic/setup.c
> @@ -956,6 +956,7 @@ void __init txx9_sramc_init(struct resource *r)
>  	if (!dev->base)
>  		goto exit;
>  	dev->dev.cls = &txx9_sramc_sysdev_class;
> +	sysfs_bin_attr_init(&dev->bindata_attr);
>  	dev->bindata_attr.attr.name = "bindata";
>  	dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR;
>  	dev->bindata_attr.read = txx9_sram_read;

-- 
Dmitry

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

* Re: [PATCH 2/3] drivers/base: init dynamic bin_attribute structures
  2010-03-12  7:03 ` [PATCH 2/3] drivers/base: " Wolfram Sang
@ 2010-03-13  2:11   ` Wolfram Sang
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2010-03-13  2:11 UTC (permalink / raw)
  To: kernel-janitors; +Cc: Greg Kroah-Hartman, Eric W. Biederman, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

On Fri, Mar 12, 2010 at 08:03:50AM +0100, Wolfram Sang wrote:
> Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.
> Found with coccinelle, but fixed manually. Compile tested on X86 where
> possible.
> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: Eric W. Biederman <ebiederm@xmission.com>

Please drop in favor of http://lkml.org/lkml/2010/3/11/57

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures
  2010-03-12 18:34   ` Dmitry Torokhov
@ 2010-03-13  2:28     ` Wolfram Sang
  2010-03-13  8:33       ` Dmitry Torokhov
  2010-03-15 17:49       ` Ralf Baechle
  0 siblings, 2 replies; 8+ messages in thread
From: Wolfram Sang @ 2010-03-13  2:28 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kernel-janitors, Ralf Baechle, Eric W. Biederman, linux-mips,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]

On Fri, Mar 12, 2010 at 10:34:51AM -0800, Dmitry Torokhov wrote:
> On Fri, Mar 12, 2010 at 08:03:49AM +0100, Wolfram Sang wrote:
> > Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.
> > Found with coccinelle, but fixed manually. Compile tested on X86 where
> > possible.
> > 
> 
> Regarding all 3 - it looks like these dynamically alocated attributes
> could be converted to statically allocated ones. I'd recommend doing
> that instead (in fact, I posted patch for the firmware_class couple days
> ago).

I agree for the firmware-patch. Regarding the MIPS one, 'size' might differ and
'private' will differ per instance. Regarding the RTC driver, 'size' might also
differ. I don't know if somebody really wants two RTCs or the SRAM for MIPS can
be instantiated more than once. Unless somebody with actual hardware jumps in,
I'd say better safe than sorry.

Thanks for the comment!

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures
  2010-03-13  2:28     ` Wolfram Sang
@ 2010-03-13  8:33       ` Dmitry Torokhov
  2010-03-15 17:49       ` Ralf Baechle
  1 sibling, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2010-03-13  8:33 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: kernel-janitors, Ralf Baechle, Eric W. Biederman, linux-mips,
	linux-kernel

On Sat, Mar 13, 2010 at 03:28:55AM +0100, Wolfram Sang wrote:
> On Fri, Mar 12, 2010 at 10:34:51AM -0800, Dmitry Torokhov wrote:
> > On Fri, Mar 12, 2010 at 08:03:49AM +0100, Wolfram Sang wrote:
> > > Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.
> > > Found with coccinelle, but fixed manually. Compile tested on X86 where
> > > possible.
> > > 
> > 
> > Regarding all 3 - it looks like these dynamically alocated attributes
> > could be converted to statically allocated ones. I'd recommend doing
> > that instead (in fact, I posted patch for the firmware_class couple days
> > ago).
> 
> I agree for the firmware-patch. Regarding the MIPS one, 'size' might differ and
> 'private' will differ per instance. Regarding the RTC driver, 'size' might also
> differ. I don't know if somebody really wants two RTCs or the SRAM for MIPS can
> be instantiated more than once. Unless somebody with actual hardware jumps in,
> I'd say better safe than sorry.
> 

Ah, right, size... I forgot about it. You are right, making the other 2
static is not an option.

-- 
Dmitry

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

* Re: [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures
  2010-03-13  2:28     ` Wolfram Sang
  2010-03-13  8:33       ` Dmitry Torokhov
@ 2010-03-15 17:49       ` Ralf Baechle
  1 sibling, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 2010-03-15 17:49 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Dmitry Torokhov, kernel-janitors, Eric W. Biederman, linux-mips,
	linux-kernel

On Sat, Mar 13, 2010 at 03:28:55AM +0100, Wolfram Sang wrote:

> > Regarding all 3 - it looks like these dynamically alocated attributes
> > could be converted to statically allocated ones. I'd recommend doing
> > that instead (in fact, I posted patch for the firmware_class couple days
> > ago).
> 
> I agree for the firmware-patch. Regarding the MIPS one, 'size' might differ and
> 'private' will differ per instance. Regarding the RTC driver, 'size' might also
> differ. I don't know if somebody really wants two RTCs or the SRAM for MIPS can
> be instantiated more than once. Unless somebody with actual hardware jumps in,
> I'd say better safe than sorry.

On the txx9 platform you've posted the patch for additional RTCs or SRAMs
would not normally be expected.  On other platforms such as IP27 there
would be one per node that is potencially very many.

  Ralf

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

end of thread, other threads:[~2010-03-15 17:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1268377431-11671-1-git-send-email-w.sang@pengutronix.de>
2010-03-12  7:03 ` [PATCH 1/3] arch/mips/txx9/generic: init dynamic bin_attribute structures Wolfram Sang
2010-03-12 18:34   ` Dmitry Torokhov
2010-03-13  2:28     ` Wolfram Sang
2010-03-13  8:33       ` Dmitry Torokhov
2010-03-15 17:49       ` Ralf Baechle
2010-03-12  7:03 ` [PATCH 2/3] drivers/base: " Wolfram Sang
2010-03-13  2:11   ` Wolfram Sang
2010-03-12  7:03 ` [PATCH 3/3] drivers/rtc: " Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox