All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org
Subject: Re: [PATCH 3/3] watchdog: Add Congatec CGEB watchdog driver
Date: Tue, 7 Feb 2012 16:08:56 +0100	[thread overview]
Message-ID: <20120207150856.GI2539@pengutronix.de> (raw)
In-Reply-To: <1328102793-4313-4-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

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

Hi Sascha,

> +struct cgeb_watchdog_stage {
> +	unsigned long timeout;
> +	unsigned long event;
> +};
> +
> +struct cgeb_watchdog_config {
> +	unsigned long size;
> +	unsigned long timeout; /* not used in staged mode */
> +	unsigned long delay;
> +	unsigned long mode;
> +	/* optional parameters for staged watchdog */
> +	unsigned long op_mode;
> +	unsigned long stage_count;
> +	struct cgeb_watchdog_stage stages[CGOS_WDOG_EVENT_MAX_STAGES];
> +};
> +

There is some unused stuff in here.

> +struct cgeb_watchdog_priv {
> +	struct cgeb_board_data	*board;
> +	struct watchdog_device	wdd;
> +	unsigned int		timeout_s;

Is wdd->timeout not sufficent?

> +	int unit;
> +};
> +
> +static int cgeb_watchdog_set_timeout(struct watchdog_device *wdd,
> +		unsigned int timeout_s)
> +{
> +	struct cgeb_watchdog_priv *priv = watchdog_get_drvdata(wdd);
> +
> +	if (!timeout_s)
> +		return -EINVAL;

Is this possible? You have min_timeout = 1.

> +static int __devinit cgeb_watchdog_probe(struct platform_device *pdev)
> +{
> +	struct cgeb_watchdog_priv *priv;
> +	struct cgeb_pdata *pdata = pdev->dev.platform_data;
> +	int ret;
> +
> +	dev_info(&pdev->dev, "registering\n");

"registered" on success would be more useful?

> +
> +	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> +	if (!priv)
> +		return -ENOMEM;
> +
> +	priv->wdd.ops = &cgeb_watchdog_ops;
> +	priv->wdd.info = &cgeb_wdd_info;
> +	priv->wdd.min_timeout = 1;
> +	priv->wdd.max_timeout = 3600;
> +	priv->board = pdata->board;
> +	priv->unit = pdata->unit;
> +
> +	watchdog_set_drvdata(&priv->wdd, priv);
> +	platform_set_drvdata(pdev, priv);
> +
> +	ret = watchdog_register_device(&priv->wdd);
> +	if (ret)
> +		return ret;
> +
> +	return 0;

return watchdog_register_device();

> +}
> +
> +static int __devexit cgeb_watchdog_remove(struct platform_device *pdev)
> +{
> +	struct cgeb_watchdog_priv *priv = platform_get_drvdata(pdev);
> +
> +	watchdog_unregister_device(&priv->wdd);
> +
> +	return 0;
> +}
> +
> +static struct platform_driver cgeb_watchdog_driver = {
> +	.probe		= cgeb_watchdog_probe,
> +	.remove		= __exit_p(cgeb_watchdog_remove),

__devexit_p

> +	.driver	= {
> +		.name	= "cgeb-watchdog",
> +		.owner	= THIS_MODULE,
> +	},
> +};
> +
> +static int __init cgeb_watchdog_driver_init(void)
> +{
> +	return platform_driver_register(&cgeb_watchdog_driver);
> +}
> +
> +static void __exit cgeb_watchdog_driver_exit(void)
> +{
> +	platform_driver_unregister(&cgeb_watchdog_driver);
> +}
> +
> +module_init(cgeb_watchdog_driver_init);
> +module_exit(cgeb_watchdog_driver_exit);

module_platform_driver()

> +
> +MODULE_AUTHOR("Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>");
> +MODULE_DESCRIPTION("cgeb watchdog driver");
> +MODULE_LICENSE("GPL");

GPL v2 according to header

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

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

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <w.sang@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-kernel@vger.kernel.org,
	Samuel Ortiz <sameo@linux.intel.com>,
	Jean Delvare <khali@linux-fr.org>,
	linux-i2c@vger.kernel.org, linux-watchdog@vger.kernel.org,
	Ben Dooks <ben-linux@fluff.org>,
	kernel@pengutronix.de
Subject: Re: [PATCH 3/3] watchdog: Add Congatec CGEB watchdog driver
Date: Tue, 7 Feb 2012 16:08:56 +0100	[thread overview]
Message-ID: <20120207150856.GI2539@pengutronix.de> (raw)
In-Reply-To: <1328102793-4313-4-git-send-email-s.hauer@pengutronix.de>

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

Hi Sascha,

> +struct cgeb_watchdog_stage {
> +	unsigned long timeout;
> +	unsigned long event;
> +};
> +
> +struct cgeb_watchdog_config {
> +	unsigned long size;
> +	unsigned long timeout; /* not used in staged mode */
> +	unsigned long delay;
> +	unsigned long mode;
> +	/* optional parameters for staged watchdog */
> +	unsigned long op_mode;
> +	unsigned long stage_count;
> +	struct cgeb_watchdog_stage stages[CGOS_WDOG_EVENT_MAX_STAGES];
> +};
> +

There is some unused stuff in here.

> +struct cgeb_watchdog_priv {
> +	struct cgeb_board_data	*board;
> +	struct watchdog_device	wdd;
> +	unsigned int		timeout_s;

Is wdd->timeout not sufficent?

> +	int unit;
> +};
> +
> +static int cgeb_watchdog_set_timeout(struct watchdog_device *wdd,
> +		unsigned int timeout_s)
> +{
> +	struct cgeb_watchdog_priv *priv = watchdog_get_drvdata(wdd);
> +
> +	if (!timeout_s)
> +		return -EINVAL;

Is this possible? You have min_timeout = 1.

> +static int __devinit cgeb_watchdog_probe(struct platform_device *pdev)
> +{
> +	struct cgeb_watchdog_priv *priv;
> +	struct cgeb_pdata *pdata = pdev->dev.platform_data;
> +	int ret;
> +
> +	dev_info(&pdev->dev, "registering\n");

"registered" on success would be more useful?

> +
> +	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> +	if (!priv)
> +		return -ENOMEM;
> +
> +	priv->wdd.ops = &cgeb_watchdog_ops;
> +	priv->wdd.info = &cgeb_wdd_info;
> +	priv->wdd.min_timeout = 1;
> +	priv->wdd.max_timeout = 3600;
> +	priv->board = pdata->board;
> +	priv->unit = pdata->unit;
> +
> +	watchdog_set_drvdata(&priv->wdd, priv);
> +	platform_set_drvdata(pdev, priv);
> +
> +	ret = watchdog_register_device(&priv->wdd);
> +	if (ret)
> +		return ret;
> +
> +	return 0;

return watchdog_register_device();

> +}
> +
> +static int __devexit cgeb_watchdog_remove(struct platform_device *pdev)
> +{
> +	struct cgeb_watchdog_priv *priv = platform_get_drvdata(pdev);
> +
> +	watchdog_unregister_device(&priv->wdd);
> +
> +	return 0;
> +}
> +
> +static struct platform_driver cgeb_watchdog_driver = {
> +	.probe		= cgeb_watchdog_probe,
> +	.remove		= __exit_p(cgeb_watchdog_remove),

__devexit_p

> +	.driver	= {
> +		.name	= "cgeb-watchdog",
> +		.owner	= THIS_MODULE,
> +	},
> +};
> +
> +static int __init cgeb_watchdog_driver_init(void)
> +{
> +	return platform_driver_register(&cgeb_watchdog_driver);
> +}
> +
> +static void __exit cgeb_watchdog_driver_exit(void)
> +{
> +	platform_driver_unregister(&cgeb_watchdog_driver);
> +}
> +
> +module_init(cgeb_watchdog_driver_init);
> +module_exit(cgeb_watchdog_driver_exit);

module_platform_driver()

> +
> +MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
> +MODULE_DESCRIPTION("cgeb watchdog driver");
> +MODULE_LICENSE("GPL");

GPL v2 according to header

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

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

  parent reply	other threads:[~2012-02-07 15:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 13:26 [RESEND] Congatec CGEB base, i2c and watchdog driver support Sascha Hauer
2012-02-01 13:26 ` [PATCH 1/3] mfd: Add basic support for the Congatec CGEB BIOS interface Sascha Hauer
     [not found]   ` <1328102793-4313-2-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-06 19:07     ` Christian Gmeiner
2012-02-06 19:07       ` Christian Gmeiner
2012-02-06 19:07       ` Christian Gmeiner
2012-02-20 16:39     ` Samuel Ortiz
2012-02-20 16:39       ` Samuel Ortiz
2012-02-20 18:07       ` Sascha Hauer
     [not found]         ` <20120220180752.GV3852-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-27 13:58           ` Samuel Ortiz
2012-02-27 13:58             ` Samuel Ortiz
2012-02-27 17:24             ` Sascha Hauer
     [not found]               ` <20120227172443.GD3852-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-28 14:32                 ` Mark Brown
2012-02-28 14:32                   ` Mark Brown
2012-02-01 13:26 ` [PATCH 2/3] i2c: Add Congatec CGEB I2C driver Sascha Hauer
2012-02-07  8:38   ` Christian Gmeiner
2012-02-07  8:38     ` Christian Gmeiner
     [not found]   ` <1328102793-4313-3-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-07 10:10     ` Wolfram Sang
2012-02-07 10:10       ` Wolfram Sang
     [not found]       ` <20120207101016.GB2539-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-15 13:54         ` Sascha Hauer
2012-02-15 13:54           ` Sascha Hauer
2012-02-13 23:22     ` Ben Dooks
2012-02-13 23:22       ` Ben Dooks
     [not found] ` <1328102793-4313-1-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-01 13:26   ` [PATCH 3/3] watchdog: Add Congatec CGEB watchdog driver Sascha Hauer
2012-02-01 13:26     ` Sascha Hauer
     [not found]     ` <1328102793-4313-4-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-07 15:08       ` Wolfram Sang [this message]
2012-02-07 15:08         ` Wolfram Sang
     [not found]         ` <20120207150856.GI2539-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-15 13:41           ` Sascha Hauer
2012-02-15 13:41             ` Sascha Hauer
2012-02-06 10:58   ` [RESEND] Congatec CGEB base, i2c and watchdog driver support Christian Gmeiner
2012-02-06 10:58     ` Christian Gmeiner
  -- strict thread matches above, loose matches on Subject: below --
2013-02-12 10:02 [PATCH] " Sascha Hauer
2013-02-12 10:02 ` [PATCH 3/3] watchdog: Add Congatec CGEB watchdog driver Sascha Hauer
     [not found]   ` <1360663374-30951-4-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-26 10:16     ` Christian Gmeiner
2013-03-26 10:16       ` Christian Gmeiner
2013-03-26 14:33       ` Guenter Roeck
     [not found]         ` <20130326143331.GA5529-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-04-03 15:09           ` Sascha Hauer
2013-04-03 15:09             ` Sascha Hauer
2013-04-03 15:30             ` Guenter Roeck
     [not found]               ` <20130403153000.GA30641-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-04-03 17:06                 ` Sascha Hauer
2013-04-03 17:06                   ` Sascha Hauer
2013-04-03 15:16       ` Sascha Hauer
2012-01-16 15:32 [RFC] Congatec CGEB base, i2c and watchdog driver support Sascha Hauer
2012-01-16 15:32 ` [PATCH 3/3] watchdog: Add Congatec CGEB watchdog driver Sascha Hauer

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=20120207150856.GI2539@pengutronix.de \
    --to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    /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.