On Mon, Aug 26, 2019 at 10:09 PM Kristian Klausen <kristian@xxxxxxxxxx> wrote: > > On 15.08.2019 05.28, Daniel Drake wrote: > > On Tue, Aug 13, 2019 at 8:30 AM Kristian Klausen <kristian@xxxxxxxxxx> wrote: > >> Most newer ASUS laptops supports settings a maximum charging percentage, > >> which help prolonging the battery life. > >> I can't pass the asus struct to asus_wmi_battery_{add,remove}, so I use a > >> global variable. Is there any better way to do it? > >> I think the implementation of asus_wmi_battery_{init,exit} could be > >> improved, any ideas? > > Added Ognjen and Rafael. > > Is there a better way to have the sysfs file handlers of files added > > via the battery hooking API reach back to the device that hooked in, > > in order to access it's private data? > > I see that thinkpad_acpi also uses global variables for this :( > For now I think it is the only option. > > I did notice that V1 of this patch has been merged into the for-next > branch by Andy[1]. > Was that a mistake Andy? and how do you want me to proceed? Should I > create a refactoring patch? V1 really isn't the proper way to do this. Oh, I see. Can it be fixed quickly? Then refactoring patch on top of the branch is preferred. Otherwise I will remove the original from the tree. Just tell me which one is more solid. > [1] > http://git.infradead.org/linux-platform-drivers-x86.git/commit/d507a54f5865d8dcbdd16c66a1a2da15640878ca -- With Best Regards, Andy Shevchenko