aboutsummaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorSimon Glass2023-04-25 10:54:52 -0600
committerTom Rini2023-04-27 13:51:07 -0400
commit9666de8332a59ff53544ffeee7f864c56a99791a (patch)
treecd05d9521fe930056f77b84cc80c12d1c98b65e4 /drivers/block
parent49aa778406a28f45dafdeb6df30f7f378ccb3925 (diff)
ide: Tidy up ide_reset()
Avoid using #ifdef and use a single function declaration, so it is easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/ide.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index 72216540d04..fb409338783 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -45,24 +45,23 @@ ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS] = {
#define IDE_SPIN_UP_TIME_OUT 5000 /* 5 sec spin-up timeout */
-#ifdef CONFIG_IDE_RESET
static void ide_reset(void)
{
- ide_set_reset(1); /* assert reset */
+ if (IS_ENABLED(CONFIG_IDE_RESET)) {
+ /* assert reset */
+ ide_set_reset(1);
- /* the reset signal shall be asserted for et least 25 us */
- udelay(25);
+ /* the reset signal shall be asserted for et least 25 us */
+ udelay(25);
- schedule();
+ schedule();
- /* de-assert RESET signal */
- ide_set_reset(0);
+ /* de-assert RESET signal */
+ ide_set_reset(0);
- mdelay(250);
+ mdelay(250);
+ }
}
-#else
-#define ide_reset() /* dummy */
-#endif /* CONFIG_IDE_RESET */
static void ide_outb(int dev, int port, unsigned char val)
{