Hi, In addition to Angelo's feedback (thanks!), On Wed, Jan 20, 2021 at 11:19:26AM +0100, AngeloGioacchino Del Regno wrote: > [...] > > +static const char * const pm8916_pon_reason[] = { > > + [0] = "Triggered from Hard Reset", > > + [1] = "Triggered from SMPL (sudden momentary power loss)", > > + [2] = "Triggered from RTC (RTC alarm expiry)", > > + [3] = "Triggered from DC (DC charger insertion)", > > + [4] = "Triggered from USB (USB charger insertion)", > > + [5] = "Triggered from PON1 (secondary PMIC)", > > + [6] = "Triggered from CBL (external power supply)", > > + [7] = "Triggered from KPD (power key press)", > > +}; > > Triggered from => Triggered by? > > > + > > +static const char * const pm8916_poff_reason[] = { > > + [0] = "Triggered from SOFT (Software)", > > + [1] = "Triggered from PS_HOLD (PS_HOLD/MSM controlled shutdown)", > > + [2] = "Triggered from PMIC_WD (PMIC watchdog)", > > + [3] = "Triggered from GP1 (Keypad_Reset1)", > > + [4] = "Triggered from GP2 (Keypad_Reset2)", > > + [5] = "Triggered from KPDPWR_AND_RESIN" > > + "(Simultaneous power key and reset line)", > > + [6] = "Triggered from RESIN_N (Reset line/Volume Down Key)", > > + [7] = "Triggered from KPDPWR_N (Long Power Key hold)", > > + [8] = "N/A", > > + [9] = "N/A", > > + [10] = "N/A", > > + [11] = "Triggered from CHARGER (Charger ENUM_TIMER, BOOT_DONE)", > > + [12] = "Triggered from TFT (Thermal Fault Tolerance)", > > + [13] = "Triggered from UVLO (Under Voltage Lock Out)", > > + [14] = "Triggered from OTST3 (Overtemp)", > > + [15] = "Triggered from STAGE3 (Stage 3 reset)", > > }; > [...] Please don't add constant prefix into the reason array. Instead put the constant part to the message printing as required. E.g.: static const char * const pm8916_pon_reason[] = { [0] = "Hard Reset", [1] = "SMPL (sudden momentary power loss)", ... }; and printing looks like this: dev_info(dev, "Power on reason: %s\n", pm8916_pon_reason[reason]); dev_info(dev, "Power off reason: %s\n", pm8916_poff_reason[reason]); Thanks, -- Sebastian
Attachment:
signature.asc
Description: PGP signature