Re: [PATCH] drm radeon: Return -EINVAL on wrong pm sysfs access

Thomas Renninger
2011-03-27T09:46:44Z

On Saturday 26 March 2011 16:38:22 Rafał Miłecki wrote:
> 2011/3/23 Thomas Renninger <trenn@suse.de>:
> > drm radeon: Return -EINVAL on wrong pm sysfs access
> >
> > Throw an error if someone tries to fill this with
> > wrong data, instead of simply ignoring the input.
> > Now you get:
> >
> > echo hello >/sys/../power_method
> > -bash: echo: write error: Invalid argument
> >
> > Signed-off-by: Thomas Renninger <trenn@suse.de>
> > CC: Alexander.Deucher@amd.com
> > CC: dri-devel@lists.freedesktop.org
> >
> > ---
> > drivers/gpu/drm/radeon/radeon_pm.c | 8 +++++---
> > 1 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> > index 2aed03b..08de669 100644
> > --- a/drivers/gpu/drm/radeon/radeon_pm.c
> > +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> > @@ -365,12 +365,14 @@ static ssize_t radeon_set_pm_profile(struct device *dev,
> > else if (strncmp("high", buf, strlen("high")) == 0)
> > rdev->pm.profile = PM_PROFILE_HIGH;
> > else {
> > - DRM_ERROR("invalid power profile!\n");
> > + count = -EINVAL;
>
> I think this does not match kernel coding style (braces).
Can you be more specific, please.
I can't see style issues, ./scripts/checkpatch.pl is also happy.

Thomas