]> git.baikalelectronics.ru Git - kernel.git/commit
dmi: extend dmi_get_year() to dmi_get_date()
authorTejun Heo <htejun@gmail.com>
Sun, 16 Aug 2009 12:02:36 +0000 (21:02 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 9 Sep 2009 01:17:48 +0000 (21:17 -0400)
commit88fc22776e58d2fa0ef50fd06ca7073e3c99dc97
tree631d41c950d2dc93c110ca86e779cb749c9a8987
parent9792087d01e3793984865952441bb21360d311ed
dmi: extend dmi_get_year() to dmi_get_date()

There are cases where full date information is required instead of
just the year.  Add month and day parsing to dmi_get_year() and rename
it to dmi_get_date().

As the original function only required '/' followed by any number of
parseable characters at the end of the string, keep that behavior to
avoid upsetting existing users.

The new function takes dates of format [mm[/dd]]/yy[yy].  Year, month
and date are checked to be in the ranges of [1-9999], [1-12] and
[1-31] respectively and any invalid or out-of-range component is
returned as zero.

The dummy implementation is updated accordingly but the return value
is updated to indicate field not found which is consistent with how
other dummy functions behave.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
arch/x86/pci/direct.c
drivers/acpi/blacklist.c
drivers/ata/ahci.c
drivers/firmware/dmi_scan.c
include/linux/dmi.h