RE: [PATCH V2 3/3] rtc: da9063: Add DA9062 RTC capability to DA9063 RTC driver
From: Opensource [Steve Twiss] <hidden>
Date: 2015-07-21 10:15:40
Also in:
linux-devicetree, linux-rtc, lkml
On 21 July 2015 11:02, Alexandre Belloni wrote: Hi Alexandre, Thanks for your help on this I will send patch v3 with the following changes ...
On 21/07/2015 at 10:43:10 +0100, S Twiss wrote :quoted
- if (val & (DA9063_E_ALARM)) + if (val & (config->rtc_event_alarm_mask))unneeded parenthesis here
changed to this: - if (val & (config->rtc_event_alarm_mask)) + if (val & config->rtc_event_alarm_mask)
quoted
+ if (of_device_is_compatible(pdev->dev.of_node, "dlg,da9063-rtc")) { + struct da9063 *chip = dev_get_drvdata(pdev->dev.parent); + + if (chip->variant_code == PMIC_DA9063_AD) + rtc->config = &da9063_ad_regs; + } else + rtc->config = match->data;Both arms of the if should use braces. Also, what happens if it is a da9063, BB variant? I guess rtc->config will not be set. maybe you should write: rtc->config = match->data; if (of_device_is_compatible(pdev->dev.of_node, "dlg,da9063-rtc")) { struct da9063 *chip = dev_get_drvdata(pdev->dev.parent); if (chip->variant_code == PMIC_DA9063_AD) rtc->config = &da9063_ad_regs; }
Sure, that is more efficient. No need for an else and explicitly defaulting the BB
register mappings.
+ rtc->config = match->data;
if (of_device_is_compatible(pdev->dev.of_node, "dlg,da9063-rtc")) {
struct da9063 *chip = dev_get_drvdata(pdev->dev.parent);
if (chip->variant_code == PMIC_DA9063_AD)
rtc->config = &da9063_ad_regs;
- } else
- rtc->config = match->data;
+ }
quoted
MODULE_AUTHOR("S Twiss [off-list ref]"); MODULE_DESCRIPTION("Real time clock device driver for Dialog DA9063"); -MODULE_LICENSE("GPL v2"); +MODULE_LICENSE("GPL");This should be part of the license change.
Sure:
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
Regards,
Steve
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html