On 19 May 2014 21:21, Daniel Lezcano daniel.lezcano@linaro.org wrote:
On 05/19/2014 01:48 PM, Viresh Kumar wrote: May be you can use the deprecated attribute also ?
int (*set_dev_mode)(enum clock_event_mode mode, struct
clock_event_device *) __deprecated;
Ahh, something new for me.
So a warning will appear at compile time (with CONFIG_ENABLE_WARN_DEPRECATED=y), letting people to know they have to migrate to the new API. But if you migrate all of them in the two next patches, 'deprecated' does not make sense.
Yeah, so all would be migrated in next few patches (maybe 100) and then it would be removed as well in the last patch.
+int clockevents_set_mode(struct clock_event_device *dev, enum clock_event_mode mode) { if (dev->mode != mode) {
dev->set_mode(mode, dev);
if (dev->set_dev_mode) {
int ret = dev->set_dev_mode(mode, dev);
/* Currently available modes are not allowed to
fail */
if (WARN_ON(ret))
return ret;
Why WARN_ON ? Is it acceptable to have a warning each time this function is called and fails ? Is this so important to have a WARN ?
Right now, yes. These calls aren't allowed to fail, that's why we had 'void' return type currently. But as soon as I implement ONESHOT_STOPPED, it would be converted like:
if (ret) { WARN_ON(mode != ONESHOT_STOPPED); return ret; }
Please update the caller function header description. It assumes that will return -ETIME on error. Did you check the impact regarding the new error
I haven't checked yet. Will look into it.
code ? And by the way what will be this error code ?
-EINVAL