.. | .. |
---|
385 | 385 | watchdog_stop_on_unregister(&wdt->wdd); |
---|
386 | 386 | |
---|
387 | 387 | ret = watchdog_register_device(&wdt->wdd); |
---|
388 | | - if (ret) { |
---|
389 | | - dev_err(dev, "unable to register watchdog device = %d.\n", ret); |
---|
| 388 | + if (ret) |
---|
390 | 389 | watchdog_set_drvdata(&wdt->wdd, NULL); |
---|
391 | | - } |
---|
392 | 390 | |
---|
393 | 391 | wdt->state = MEI_WDT_IDLE; |
---|
394 | 392 | |
---|
.. | .. |
---|
540 | 538 | wdt->dbgfs_dir = NULL; |
---|
541 | 539 | } |
---|
542 | 540 | |
---|
543 | | -static int dbgfs_register(struct mei_wdt *wdt) |
---|
| 541 | +static void dbgfs_register(struct mei_wdt *wdt) |
---|
544 | 542 | { |
---|
545 | | - struct dentry *dir, *f; |
---|
| 543 | + struct dentry *dir; |
---|
546 | 544 | |
---|
547 | 545 | dir = debugfs_create_dir(KBUILD_MODNAME, NULL); |
---|
548 | | - if (!dir) |
---|
549 | | - return -ENOMEM; |
---|
550 | | - |
---|
551 | 546 | wdt->dbgfs_dir = dir; |
---|
552 | | - f = debugfs_create_file("state", S_IRUSR, dir, wdt, &dbgfs_fops_state); |
---|
553 | | - if (!f) |
---|
554 | | - goto err; |
---|
555 | 547 | |
---|
556 | | - f = debugfs_create_file("activation", S_IRUSR, |
---|
557 | | - dir, wdt, &dbgfs_fops_activation); |
---|
558 | | - if (!f) |
---|
559 | | - goto err; |
---|
| 548 | + debugfs_create_file("state", S_IRUSR, dir, wdt, &dbgfs_fops_state); |
---|
560 | 549 | |
---|
561 | | - return 0; |
---|
562 | | -err: |
---|
563 | | - dbgfs_unregister(wdt); |
---|
564 | | - return -ENODEV; |
---|
| 550 | + debugfs_create_file("activation", S_IRUSR, dir, wdt, |
---|
| 551 | + &dbgfs_fops_activation); |
---|
565 | 552 | } |
---|
566 | 553 | |
---|
567 | 554 | #else |
---|
568 | 555 | |
---|
569 | 556 | static inline void dbgfs_unregister(struct mei_wdt *wdt) {} |
---|
570 | | - |
---|
571 | | -static inline int dbgfs_register(struct mei_wdt *wdt) |
---|
572 | | -{ |
---|
573 | | - return 0; |
---|
574 | | -} |
---|
| 557 | +static inline void dbgfs_register(struct mei_wdt *wdt) {} |
---|
575 | 558 | #endif /* CONFIG_DEBUG_FS */ |
---|
576 | 559 | |
---|
577 | 560 | static int mei_wdt_probe(struct mei_cl_device *cldev, |
---|
.. | .. |
---|
624 | 607 | if (ret) |
---|
625 | 608 | goto err_disable; |
---|
626 | 609 | |
---|
627 | | - if (dbgfs_register(wdt)) |
---|
628 | | - dev_warn(&cldev->dev, "cannot register debugfs\n"); |
---|
| 610 | + dbgfs_register(wdt); |
---|
629 | 611 | |
---|
630 | 612 | return 0; |
---|
631 | 613 | |
---|