> +#ifdef CONFIG_PM_RUNTIME
> +#include <linux/pm_runtime.h>
> +#endif

You want the include anyway - it defines dummy versions of the
functions to avoid ifdef everywhere else when PM_RUNTIME is not set.


> +static ssize_t mpu3050_store_power_mode(struct device *dev,
> +             struct device_attribute *attr, const char *buf,
> size_t count)
> +{
> +     struct mpu3050_sensor *sensor = dev_get_drvdata(dev);
> +
> +     if (!count || !(buf[0] == '1' || buf[0] == '0'))
> +             return count;
> +
> +     mutex_lock(&sensor->lock);
> +     mpu3050_set_power_mode(sensor->client, buf[0] == '1' ? 1 :
> 0);
> +     mutex_unlock(&sensor->lock);

Same problem as with the bma023 - this will confuse the power handling
if pm_runtime is in use.

Looks good to me so I'll merge this then sort the ifdefs out and think
about how to fix the store_power_mode in both cases. I have an idea how
to do it right, need to investigate.

Alan
_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to