Re: [PATCH v2 1/3] misc: servo-pwm: driver for controlling servo motors via PWM

Greg Kroah-Hartman
2023-02-17T15:36:17Z

On Fri, Feb 17, 2023 at 03:57:28PM +0100, Angelo Compagnucci wrote:
> This patch adds a simple driver to control servo motor position via
> PWM signal.
> The driver allows to set the angle from userspace, while min/max
> positions duty cycle and the motor degrees aperture are defined in
> the dts.
>
> Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
> ---
> MAINTAINERS | 6 ++
> drivers/misc/Kconfig | 11 +++
> drivers/misc/Makefile | 1 +
> drivers/misc/servo-pwm.c | 149 +++++++++++++++++++++++++++++++++++++++

You add sysfs files but do not document them in Documentation/ABI/ which
is required. Please do so in your next version of this patch.

> +static ssize_t degrees_show(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> + struct servo_pwm_data *data = dev_get_drvdata(dev);
> +
> + return snprintf(buf, PAGE_SIZE, "%u\n", data->degrees);

sysfs_emit() please.

thanks,

greg k-h