Skip to content

Commit

Permalink
watchdog: sp5100_tco: Use request_muxed_region where possible
Browse files Browse the repository at this point in the history
Use request_muxed_region for multiplexed IO memory regions.
Also, SP5100_IO_PM_INDEX_REG/SP5100_IO_PM_DATA_REG are only
used during initialization; it is unnecessary to keep the
address range reserved.

Cc: Zoltán Böszörményi <zboszor@pr.hu>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Guenter Roeck authored and Wim Van Sebroeck committed Jan 21, 2018
1 parent f541c09 commit 16e7730
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/watchdog/sp5100_tco.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ static unsigned char sp5100_tco_setupdevice(void)
}

/* Request the IO ports used by this driver */
if (!request_region(SP5100_IO_PM_INDEX_REG, SP5100_PM_IOPORTS_SIZE,
dev_name)) {
if (!request_muxed_region(SP5100_IO_PM_INDEX_REG,
SP5100_PM_IOPORTS_SIZE, dev_name)) {
pr_err("I/O address 0x%04x already in use\n",
SP5100_IO_PM_INDEX_REG);
goto exit;
Expand Down Expand Up @@ -468,6 +468,7 @@ static unsigned char sp5100_tco_setupdevice(void)
*/
tco_timer_stop();

release_region(SP5100_IO_PM_INDEX_REG, SP5100_PM_IOPORTS_SIZE);
/* Done */
return 1;

Expand Down Expand Up @@ -521,7 +522,6 @@ static int sp5100_tco_init(struct platform_device *dev)
exit:
iounmap(tcobase);
release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
release_region(SP5100_IO_PM_INDEX_REG, SP5100_PM_IOPORTS_SIZE);
return ret;
}

Expand All @@ -535,7 +535,6 @@ static void sp5100_tco_cleanup(void)
misc_deregister(&sp5100_tco_miscdev);
iounmap(tcobase);
release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
release_region(SP5100_IO_PM_INDEX_REG, SP5100_PM_IOPORTS_SIZE);
}

static int sp5100_tco_remove(struct platform_device *dev)
Expand Down

0 comments on commit 16e7730

Please sign in to comment.