[Intel-gfx] [RFC PATCH 4/5] drm/i915/display: prepend connector name to the backlight

Murthy, Arun R arun.r.murthy at intel.com
Fri Jun 3 03:34:22 UTC 2022


> On Thu, 02 Jun 2022, Animesh Manna <animesh.manna at intel.com> wrote:
> > From: Arun R Murthy <arun.r.murthy at intel.com>
> >
> > With the enablement of dual eDP, there will have to exist two entries
> > of backlight sysfs file. In order to avoid sysfs file name
> > duplication, the file names are prepended with the connector name.
> 
> Fixed by 20f85ef89d94 ("drm/i915/backlight: use unique backlight device
> names") about a year ago.
> 
This patches checks if the return value is -EEXIST and then acts accordingly, but -EEXIST is not returned.
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
                                         const char *name,
                                         umode_t mode, kuid_t uid, kgid_t gid,
                                         loff_t size,
                                         const struct kernfs_ops *ops,
                                         void *priv, const void *ns,
                                         struct lock_class_key *key)
{
        struct kernfs_node *kn;
        unsigned flags;
        int rc;

        flags = KERNFS_FILE;

        kn = kernfs_new_node(parent, name, (mode & S_IALLUGO) | S_IFREG,
                             uid, gid, flags);
        if (!kn)
                return ERR_PTR(-ENOMEM);

So the condition check with not be satisfied and the backlight registration will fail for the 2nd backlight device.

Thanks and Regards,
Arun R Murthy
--------------------


More information about the Intel-gfx mailing list