Bumblebee-Project / bbswitch

Disable discrete graphics (currently nvidia only)
GNU General Public License v2.0
491 stars 78 forks source link

Use proc_ops structure for kernel version >= 5.6.0 #196

Closed mateuszmandera closed 4 years ago

mateuszmandera commented 4 years ago

Since 5.6.0, proc_create requires a proc_ops argument instead of file_operations.

It compiles and seems to work on my machine, but I haven't done much testing. Please review if this is the correct way to migrate to the new structure.

rien333 commented 4 years ago

Yes please, this totally breaks on 5.6 otherwhise. Not sure if this is still even in development tho @Lekensteyn

rhysperry111 commented 4 years ago

Please merge ASAP. I know this repo is basically unmaintained but this is important

someonewithpc commented 4 years ago

Welp, was going to open the same pull request. Can confirm it seems to work

@Lekensteyn Not wanting to be rude, but this is urgent for rolling release users

rhysperry111 commented 4 years ago

Ok guys, It seems this repo is unmaintained. Is it time to fork it?

bluca commented 4 years ago

Ok guys, It seems this repo is unmaintained. Is it time to fork it?

Please be patient. 5.6 is scarcely used. Rolling distros can have a patch for now.

Lekensteyn commented 4 years ago

I can look into this later. It would help if you could track down the upstream commit and mention it in the commit message. That should make it clear whether this approach is the right one or not.

mateuszmandera commented 4 years ago

@Lekensteyn https://github.com/torvalds/linux/commit/d56c0d45f0e27f814e87a1676b6bdccccbc252e9 (added to my commit message as well)

rien333 commented 4 years ago

Please be patient. 5.6 is scarcely used. Rolling distros can have a patch for now.

The change is very small though, and people have reported that it works. 5.7 will be released somewhere after next week. Fedora is already on 5.6.

Also, it might very well be that bbswitch is most popular among technically-inclined users, like those on rolling distros. More generally, I don't think that Arch and Manjaro are that scarcely used. (manjaro is ranked second on distrowatch, if that says anything)

Lekensteyn commented 4 years ago

Thanks for the fix and sorry for the delay. I made some whitespace changes, removed the unnecessary proc_fs.h include (it is implied via linux/acpi.h -> acpi/acpi_bus.h) and tweaked the commit message a bit.