watchdog: ar7_wdt: Make use of the helper function devm_platform_ioremap_resource_byname()
Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210907074223.2706-1-caihuoqing@baidu.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
parent
94213a39c3
commit
54ccba2f6a
|
@ -63,8 +63,6 @@ static DEFINE_SPINLOCK(wdt_lock);
|
||||||
/* XXX currently fixed, allows max margin ~68.72 secs */
|
/* XXX currently fixed, allows max margin ~68.72 secs */
|
||||||
#define prescale_value 0xffff
|
#define prescale_value 0xffff
|
||||||
|
|
||||||
/* Resource of the WDT registers */
|
|
||||||
static struct resource *ar7_regs_wdt;
|
|
||||||
/* Pointer to the remapped WDT IO space */
|
/* Pointer to the remapped WDT IO space */
|
||||||
static struct ar7_wdt *ar7_wdt;
|
static struct ar7_wdt *ar7_wdt;
|
||||||
|
|
||||||
|
@ -265,9 +263,7 @@ static int ar7_wdt_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
ar7_regs_wdt =
|
ar7_wdt = devm_platform_ioremap_resource_byname(pdev, "regs");
|
||||||
platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
|
|
||||||
ar7_wdt = devm_ioremap_resource(&pdev->dev, ar7_regs_wdt);
|
|
||||||
if (IS_ERR(ar7_wdt))
|
if (IS_ERR(ar7_wdt))
|
||||||
return PTR_ERR(ar7_wdt);
|
return PTR_ERR(ar7_wdt);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue