lkml.org 
[lkml]   [2012]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/3] watchdog: Add Congatec CGEB watchdog driver
    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/ |
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2012-02-07 16:11    [W:0.030 / U:30.464 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site