* Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote: > Uninline dmi_get_bios_year() which, in particular, allows us > to optimize it in the future. > > While doing this, convert the function to return an error code > when BIOS date is not present or not parsable, or CONFIG_DMI=n. > > Additionally, during the move, add a bit of documentation. > > Fixes: 492a1abd61e4 ("dmi: Introduce the dmi_get_bios_year() helper function") > Suggested-by: Bjorn Helgaas <helgaas@xxxxxxxxxx> > Suggested-by: Rafael J. Wysocki <rafael@xxxxxxxxxx> > Reviewed-by: Jean Delvare <jdelvare@xxxxxxx> > Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> > --- > drivers/firmware/dmi_scan.c | 20 ++++++++++++++++++++ > include/linux/dmi.h | 11 ++--------- > 2 files changed, 22 insertions(+), 9 deletions(-) > > diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c > index ae4f1b181c23..bfb6ce6abc83 100644 > --- a/drivers/firmware/dmi_scan.c > +++ b/drivers/firmware/dmi_scan.c > @@ -1040,6 +1040,26 @@ bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) > } > EXPORT_SYMBOL(dmi_get_date); > > +/** > + * dmi_get_bios_year - get a year out of DMI_BIOS_DATE field > + * > + * Returns year on success, -ENXIO if DMI is not selected, > + * or a different negative error code if DMI field is not present > + * or not parsable. s/parsable/parseable I have fixed this in the version I've applied - which I'll push out if it passes testing. Thanks, Ingo