The patch titled Subject: drivers/rtc/rtc-max6902.c: use register defines instead of magic numbers has been added to the -mm tree. Its filename is drivers-rtc-rtc-max6902c-use-register-defines-instead-of-magic-numbers.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Axel Lin <axel.lin@xxxxxxxxxx> Subject: drivers/rtc/rtc-max6902.c: use register defines instead of magic numbers Current code has defines for registers, use the defines rather than magic numbers. Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx> Cc: Raphael Assenat <raph@xxxxxxxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Cc: Wu Fengguang <fengguang.wu@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-max6902.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff -puN drivers/rtc/rtc-max6902.c~drivers-rtc-rtc-max6902c-use-register-defines-instead-of-magic-numbers drivers/rtc/rtc-max6902.c --- a/drivers/rtc/rtc-max6902.c~drivers-rtc-rtc-max6902c-use-register-defines-instead-of-magic-numbers +++ a/drivers/rtc/rtc-max6902.c @@ -93,24 +93,24 @@ static int max6902_set_time(struct devic dt->tm_year = dt->tm_year + 1900; /* Remove write protection */ - max6902_set_reg(dev, 0xF, 0); + max6902_set_reg(dev, MAX6902_REG_CONTROL, 0); - max6902_set_reg(dev, 0x01, bin2bcd(dt->tm_sec)); - max6902_set_reg(dev, 0x03, bin2bcd(dt->tm_min)); - max6902_set_reg(dev, 0x05, bin2bcd(dt->tm_hour)); - - max6902_set_reg(dev, 0x07, bin2bcd(dt->tm_mday)); - max6902_set_reg(dev, 0x09, bin2bcd(dt->tm_mon + 1)); - max6902_set_reg(dev, 0x0B, bin2bcd(dt->tm_wday)); - max6902_set_reg(dev, 0x0D, bin2bcd(dt->tm_year % 100)); - max6902_set_reg(dev, 0x13, bin2bcd(dt->tm_year / 100)); + max6902_set_reg(dev, MAX6902_REG_SECONDS, bin2bcd(dt->tm_sec)); + max6902_set_reg(dev, MAX6902_REG_MINUTES, bin2bcd(dt->tm_min)); + max6902_set_reg(dev, MAX6902_REG_HOURS, bin2bcd(dt->tm_hour)); + + max6902_set_reg(dev, MAX6902_REG_DATE, bin2bcd(dt->tm_mday)); + max6902_set_reg(dev, MAX6902_REG_MONTH, bin2bcd(dt->tm_mon + 1)); + max6902_set_reg(dev, MAX6902_REG_DAY, bin2bcd(dt->tm_wday)); + max6902_set_reg(dev, MAX6902_REG_YEAR, bin2bcd(dt->tm_year % 100)); + max6902_set_reg(dev, MAX6902_REG_CENTURY, bin2bcd(dt->tm_year / 100)); /* Compulab used a delay here. However, the datasheet * does not mention a delay being required anywhere... */ /* delay(2000); */ /* Write protect */ - max6902_set_reg(dev, 0xF, 0x80); + max6902_set_reg(dev, MAX6902_REG_CONTROL, 0x80); return 0; } _ Patches currently in -mm which might be from axel.lin@xxxxxxxxxx are linux-next.patch drivers-rtc-rtc-max6902c-use-register-defines-instead-of-magic-numbers.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html