Skip to contentSkip to conversation

+ drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Aug 29, 2013 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

Subject: + drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource.patch added to -mm tree
To: [email protected],[email protected]
From: [email protected]
Date: Thu, 29 Aug 2013 15:03:31 -0700

The patch titled
Subject: drivers/rtc/rtc-ds1742.c: use devm_ioremap_resource()
has been added to the -mm tree. Its filename is
drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Alexander Shiyan <[email protected]>
Subject: drivers/rtc/rtc-ds1742.c: use devm_ioremap_resource()

Replace devm_request_mem_region() and devm_ioremap() with devm_ioremap_resource().

---

 drivers/rtc/rtc-ds1742.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/rtc/rtc-ds1742.c renamed from drivers/rtc/rtc-ds1742.c~drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource +6 -12
diff -puN drivers/rtc/rtc-ds1742.c~drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource drivers/rtc/rtc-ds1742.c
@@ -56,7 +56,6 @@ struct rtc_plat_data {
 	void __iomem *ioaddr_nvram;
 	void __iomem *ioaddr_rtc;
 	size_t size_nvram;
-	size_t size;
 	unsigned long last_jiffies;
 	struct bin_attribute nvram_attr;
 };
@@ -168,22 +167,17 @@ static int ds1742_rtc_probe(struct platf
 	void __iomem *ioaddr;
 	int ret = 0;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
 	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata)
 		return -ENOMEM;
-	pdata->size = resource_size(res);
-	if (!devm_request_mem_region(&pdev->dev, res->start, pdata->size,
-		pdev->name))
-		return -EBUSY;
-	ioaddr = devm_ioremap(&pdev->dev, res->start, pdata->size);
-	if (!ioaddr)
-		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	ioaddr = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(ioaddr))
+		return PTR_ERR(ioaddr);
 
 	pdata->ioaddr_nvram = ioaddr;
-	pdata->size_nvram = pdata->size - RTC_SIZE;
+	pdata->size_nvram = resource_size(res) - RTC_SIZE;
 	pdata->ioaddr_rtc = ioaddr + pdata->size_nvram;
 
 	sysfs_bin_attr_init(&pdata->nvram_attr);

_

Patches currently in -mm which might be from [email protected] are

drivers-rtc-rtc-ds1742c-use-devm_ioremap_resource.patch drivers-rtc-rtc-ds1742c-remove-unused-field-rtc-from-private-structure.patch drivers-rtc-rtc-ds1742c-report-to-rtc-core-if-retrieved-time-is-invalid.patch linux-next.patch