diff options
Diffstat (limited to 'drivers/rtc/rtc-ds1742.c')
| -rw-r--r-- | drivers/rtc/rtc-ds1742.c | 15 | 
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c index 17b73fdc3b6..c6b2191a412 100644 --- a/drivers/rtc/rtc-ds1742.c +++ b/drivers/rtc/rtc-ds1742.c @@ -13,12 +13,13 @@   */  #include <linux/bcd.h> -#include <linux/init.h>  #include <linux/kernel.h>  #include <linux/gfp.h>  #include <linux/delay.h>  #include <linux/jiffies.h>  #include <linux/rtc.h> +#include <linux/of.h> +#include <linux/of_device.h>  #include <linux/platform_device.h>  #include <linux/io.h>  #include <linux/module.h> @@ -203,8 +204,11 @@ static int ds1742_rtc_probe(struct platform_device *pdev)  		return PTR_ERR(rtc);  	ret = sysfs_create_bin_file(&pdev->dev.kobj, &pdata->nvram_attr); +	if (ret) +		dev_err(&pdev->dev, "Unable to create sysfs entry: %s\n", +			pdata->nvram_attr.attr.name); -	return ret; +	return 0;  }  static int ds1742_rtc_remove(struct platform_device *pdev) @@ -215,12 +219,19 @@ static int ds1742_rtc_remove(struct platform_device *pdev)  	return 0;  } +static const struct of_device_id __maybe_unused ds1742_rtc_of_match[] = { +	{ .compatible = "maxim,ds1742", }, +	{ } +}; +MODULE_DEVICE_TABLE(of, ds1742_rtc_of_match); +  static struct platform_driver ds1742_rtc_driver = {  	.probe		= ds1742_rtc_probe,  	.remove		= ds1742_rtc_remove,  	.driver		= {  		.name	= "rtc-ds1742",  		.owner	= THIS_MODULE, +		.of_match_table = ds1742_rtc_of_match,  	},  };  | 
