All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/5200: remove sysfs debug file from GPT driver
@ 2009-03-06 20:30 Grant Likely
  2009-03-06 20:31 ` Grant Likely
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2009-03-06 20:30 UTC (permalink / raw)
  To: linuxppc-dev

From: Grant Likely <grant.likely@secretlab.ca>

Remove poorly designed debug sysfs attribute entry from the GPT driver.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/platforms/52xx/mpc52xx_gpt.c |   39 -----------------------------
 1 files changed, 0 insertions(+), 39 deletions(-)


diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
index cb038dc..bfbcd41 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -335,44 +335,6 @@ static void
 mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *p, struct device_node *np) { }
 #endif /* defined(CONFIG_GPIOLIB) */
 
-/***********************************************************************
- * SYSFS attributes
- */
-#if defined(CONFIG_SYSFS)
-static ssize_t mpc52xx_gpt_show_regs(struct device *dev,
-				     struct device_attribute *attr, char *buf)
-{
-	struct mpc52xx_gpt_priv *gpt = dev_get_drvdata(dev);
-	int i, len = 0;
-	u32 __iomem *regs = (void __iomem *) gpt->regs;
-
-	for (i = 0; i < 4; i++)
-		len += sprintf(buf + len, "%.8x ", in_be32(regs + i));
-	len += sprintf(buf + len, "\n");
-
-	return len;
-}
-
-static struct device_attribute mpc52xx_gpt_attrib[] = {
-	__ATTR(regs, S_IRUGO | S_IWUSR, mpc52xx_gpt_show_regs, NULL),
-};
-
-static void mpc52xx_gpt_create_attribs(struct mpc52xx_gpt_priv *gpt)
-{
-	int i, err = 0;
-
-	for (i = 0; i < ARRAY_SIZE(mpc52xx_gpt_attrib); i++) {
-		err = device_create_file(gpt->dev, &mpc52xx_gpt_attrib[i]);
-		if (err)
-			dev_err(gpt->dev, "error creating attribute %i\n", i);
-	}
-
-}
-
-#else /* defined(CONFIG_SYSFS) */
-static void mpc52xx_gpt_create_attribs(struct mpc52xx_gpt_priv *) { return 0; }
-#endif /* defined(CONFIG_SYSFS) */
-
 /* ---------------------------------------------------------------------
  * of_platform bus binding code
  */
@@ -395,7 +357,6 @@ static int __devinit mpc52xx_gpt_probe(struct of_device *ofdev,
 
 	dev_set_drvdata(&ofdev->dev, gpt);
 
-	mpc52xx_gpt_create_attribs(gpt);
 	mpc52xx_gpt_gpio_setup(gpt, ofdev->node);
 	mpc52xx_gpt_irq_setup(gpt, ofdev->node);
 

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

* Re: [PATCH] powerpc/5200: remove sysfs debug file from GPT driver
  2009-03-06 20:30 [PATCH] powerpc/5200: remove sysfs debug file from GPT driver Grant Likely
@ 2009-03-06 20:31 ` Grant Likely
  2009-03-07 10:13   ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2009-03-06 20:31 UTC (permalink / raw)
  To: linuxppc-dev

Wolfram, you were right.  This was a bad idea.  I just took me a bit
longer to clue into it.

g.

On Fri, Mar 6, 2009 at 1:30 PM, Grant Likely <grant.likely@secretlab.ca> wr=
ote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Remove poorly designed debug sysfs attribute entry from the GPT driver.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
> =A0arch/powerpc/platforms/52xx/mpc52xx_gpt.c | =A0 39 -------------------=
----------
> =A01 files changed, 0 insertions(+), 39 deletions(-)
>
>
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/pla=
tforms/52xx/mpc52xx_gpt.c
> index cb038dc..bfbcd41 100644
> --- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
> @@ -335,44 +335,6 @@ static void
> =A0mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *p, struct device_node =
*np) { }
> =A0#endif /* defined(CONFIG_GPIOLIB) */
>
> -/***********************************************************************
> - * SYSFS attributes
> - */
> -#if defined(CONFIG_SYSFS)
> -static ssize_t mpc52xx_gpt_show_regs(struct device *dev,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
struct device_attribute *attr, char *buf)
> -{
> - =A0 =A0 =A0 struct mpc52xx_gpt_priv *gpt =3D dev_get_drvdata(dev);
> - =A0 =A0 =A0 int i, len =3D 0;
> - =A0 =A0 =A0 u32 __iomem *regs =3D (void __iomem *) gpt->regs;
> -
> - =A0 =A0 =A0 for (i =3D 0; i < 4; i++)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 len +=3D sprintf(buf + len, "%.8x ", in_be3=
2(regs + i));
> - =A0 =A0 =A0 len +=3D sprintf(buf + len, "\n");
> -
> - =A0 =A0 =A0 return len;
> -}
> -
> -static struct device_attribute mpc52xx_gpt_attrib[] =3D {
> - =A0 =A0 =A0 __ATTR(regs, S_IRUGO | S_IWUSR, mpc52xx_gpt_show_regs, NULL=
),
> -};
> -
> -static void mpc52xx_gpt_create_attribs(struct mpc52xx_gpt_priv *gpt)
> -{
> - =A0 =A0 =A0 int i, err =3D 0;
> -
> - =A0 =A0 =A0 for (i =3D 0; i < ARRAY_SIZE(mpc52xx_gpt_attrib); i++) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D device_create_file(gpt->dev, &mpc52=
xx_gpt_attrib[i]);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (err)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(gpt->dev, "error cr=
eating attribute %i\n", i);
> - =A0 =A0 =A0 }
> -
> -}
> -
> -#else /* defined(CONFIG_SYSFS) */
> -static void mpc52xx_gpt_create_attribs(struct mpc52xx_gpt_priv *) { retu=
rn 0; }
> -#endif /* defined(CONFIG_SYSFS) */
> -
> =A0/* -------------------------------------------------------------------=
--
> =A0* of_platform bus binding code
> =A0*/
> @@ -395,7 +357,6 @@ static int __devinit mpc52xx_gpt_probe(struct of_devi=
ce *ofdev,
>
> =A0 =A0 =A0 =A0dev_set_drvdata(&ofdev->dev, gpt);
>
> - =A0 =A0 =A0 mpc52xx_gpt_create_attribs(gpt);
> =A0 =A0 =A0 =A0mpc52xx_gpt_gpio_setup(gpt, ofdev->node);
> =A0 =A0 =A0 =A0mpc52xx_gpt_irq_setup(gpt, ofdev->node);
>
>
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: [PATCH] powerpc/5200: remove sysfs debug file from GPT driver
  2009-03-06 20:31 ` Grant Likely
@ 2009-03-07 10:13   ` Wolfram Sang
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2009-03-07 10:13 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev

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

On Fri, Mar 06, 2009 at 01:31:41PM -0700, Grant Likely wrote:
> Wolfram, you were right.  This was a bad idea.  I just took me a bit
> longer to clue into it.

Instant ACK :D Thanks!

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
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] 3+ messages in thread

end of thread, other threads:[~2009-03-07 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-06 20:30 [PATCH] powerpc/5200: remove sysfs debug file from GPT driver Grant Likely
2009-03-06 20:31 ` Grant Likely
2009-03-07 10:13   ` Wolfram Sang

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.