Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: lpddr: Move function print_drs_error to lpddr_cmds.c

Function print_drs_error is only used in drivers/mtd/lpddr/lpddr_cmds.c
so, better to move it there.

Also, notice that there's no need for inline as the function is used
once. Lastly, fix the following checkpatch warning:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
+static void print_drs_error(unsigned dsr)

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/e0063cbd65f3b47be1db34efc494ea3047634d88.1588016644.git.gustavo@embeddedor.com

authored by

Gustavo A. R. Silva and committed by
Miquel Raynal
1a64026e 518693ab

+28 -28
+28
drivers/mtd/lpddr/lpddr_cmds.c
··· 94 94 } 95 95 EXPORT_SYMBOL(lpddr_cmdset); 96 96 97 + static void print_drs_error(unsigned int dsr) 98 + { 99 + int prog_status = (dsr & DSR_RPS) >> 8; 100 + 101 + if (!(dsr & DSR_AVAILABLE)) 102 + pr_notice("DSR.15: (0) Device not Available\n"); 103 + if ((prog_status & 0x03) == 0x03) 104 + pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n"); 105 + else if (prog_status & 0x02) 106 + pr_notice("DSR.9,8: (10) Object Mode Program attempt in region with Control Mode data\n"); 107 + else if (prog_status & 0x01) 108 + pr_notice("DSR.9,8: (01) Program attempt in region with Object Mode data\n"); 109 + if (!(dsr & DSR_READY_STATUS)) 110 + pr_notice("DSR.7: (0) Device is Busy\n"); 111 + if (dsr & DSR_ESS) 112 + pr_notice("DSR.6: (1) Erase Suspended\n"); 113 + if (dsr & DSR_ERASE_STATUS) 114 + pr_notice("DSR.5: (1) Erase/Blank check error\n"); 115 + if (dsr & DSR_PROGRAM_STATUS) 116 + pr_notice("DSR.4: (1) Program Error\n"); 117 + if (dsr & DSR_VPPS) 118 + pr_notice("DSR.3: (1) Vpp low detect, operation aborted\n"); 119 + if (dsr & DSR_PSS) 120 + pr_notice("DSR.2: (1) Program suspended\n"); 121 + if (dsr & DSR_DPS) 122 + pr_notice("DSR.1: (1) Aborted Erase/Program attempt on locked block\n"); 123 + } 124 + 97 125 static int wait_for_ready(struct map_info *map, struct flchip *chip, 98 126 unsigned int chip_op_time) 99 127 {
-28
include/linux/mtd/pfow.h
··· 121 121 map_write(map, CMD(LPDDR_START_EXECUTION), 122 122 map->pfow_base + PFOW_COMMAND_EXECUTE); 123 123 } 124 - 125 - static inline void print_drs_error(unsigned dsr) 126 - { 127 - int prog_status = (dsr & DSR_RPS) >> 8; 128 - 129 - if (!(dsr & DSR_AVAILABLE)) 130 - pr_notice("DSR.15: (0) Device not Available\n"); 131 - if ((prog_status & 0x03) == 0x03) 132 - pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n"); 133 - else if (prog_status & 0x02) 134 - pr_notice("DSR.9,8: (10) Object Mode Program attempt in region with Control Mode data\n"); 135 - else if (prog_status & 0x01) 136 - pr_notice("DSR.9,8: (01) Program attempt in region with Object Mode data\n"); 137 - if (!(dsr & DSR_READY_STATUS)) 138 - pr_notice("DSR.7: (0) Device is Busy\n"); 139 - if (dsr & DSR_ESS) 140 - pr_notice("DSR.6: (1) Erase Suspended\n"); 141 - if (dsr & DSR_ERASE_STATUS) 142 - pr_notice("DSR.5: (1) Erase/Blank check error\n"); 143 - if (dsr & DSR_PROGRAM_STATUS) 144 - pr_notice("DSR.4: (1) Program Error\n"); 145 - if (dsr & DSR_VPPS) 146 - pr_notice("DSR.3: (1) Vpp low detect, operation aborted\n"); 147 - if (dsr & DSR_PSS) 148 - pr_notice("DSR.2: (1) Program suspended\n"); 149 - if (dsr & DSR_DPS) 150 - pr_notice("DSR.1: (1) Aborted Erase/Program attempt on locked block\n"); 151 - } 152 124 #endif /* __LINUX_MTD_PFOW_H */