Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update smi_stream_dev.c #176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

unixpunk
Copy link
Contributor

This fixes building on DragonOS_Pi64 - not sure if it breaks other OSes or not, though.

/home/ubuntu/cariboulite/driver/build/smi_stream_dev.c:1319:28: error: too many arguments to function ‘class_create’
1319 | smi_stream_class = class_create(THIS_MODULE, DEVICE_NAME);

This fixes building on DragonOS_Pi64 - not sure if it breaks other OSes or not, though.

/home/ubuntu/cariboulite/driver/build/smi_stream_dev.c:1319:28: error: too many arguments to function ‘class_create’
 1319 |         smi_stream_class = class_create(THIS_MODULE, DEVICE_NAME);
@alphafox02
Copy link

To confirm, this resolved the issue building CaribouLite on the latest DragonOS Pi64 (22.04 Ubuntu) after it switched to the 6.5 kernel for Pi5 support. I haven’t tested running the hat on a pi5 but it did run fine on the Pi4. I’ll add to DragonOS when I get a chance..

@unixpunk
Copy link
Contributor Author

i had run through this on my pi4, then i swapped the hat and sd card to the pi5 and it all worked just the same.

@unixpunk
Copy link
Contributor Author

hm but now im having an issue doing it from scratch on the pi 5, i can't get /dev/gpiomem to exist, there are only 0-4 variants, unlike my pi 4. will investigate/compare things later to see what's going on.

@alphafox02
Copy link

That’s strange so doing it from scratch on Pi4 is okay, transferring sd to pi5 is okay, but then you can’t do it from scratch? I swear in my case I did it from scratch on Pi5 but moved sd to the 4. I’ll do it all again asap.

@unixpunk
Copy link
Contributor Author

@alphafox02 so it looks like the gpiomem interface was changed and this will require a change above my head here to get it working. i found someone saying that the 40-pin header was part of /dev/gpiomem4, but creating a symlink from gpiomem to gpiomem4 and running SoapySDRUtil caused the system to freeze up instantly. that's the only quick guess i had on this. pi 5 support may not be here yet, but at least you can build with the new kernel on a pi 4.

@@ -1316,7 +1316,7 @@ static int smi_stream_dev_probe(struct platform_device *pdev)
}

// Create sysfs entries with "smi-stream-dev"
smi_stream_class = class_create(THIS_MODULE, DEVICE_NAME);
smi_stream_class = class_create(DEVICE_NAME);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't compile. macro class_create requires two parameters

./cariboulite/driver/build/smi_stream_dev.c:1319:45: error: macro "class_create" requires 2 arguments, but only 1 given
 1319 |  smi_stream_class = class_create(DEVICE_NAME);
      |                                             ^
In file included from ./include/linux/platform_device.h:13,
                 ./cariboulite/driver/build/smi_stream_dev.c:44:
./include/linux/device.h:778: note: macro "class_create" defined here
  778 | #define class_create(owner, name)  \
      | 
./cariboulite/driver/build/smi_stream_dev.c:1319:21: error: ‘class_create’ undeclared (first use in this function); did you mean ‘vfs_create’?
 1319 |  smi_stream_class = class_create(DEVICE_NAME);

Copy link

@great9 great9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macro class_create requires two params

@alphafox02
Copy link

Did you check out the patch-1 branch?

@unixpunk
Copy link
Contributor Author

all i know is it doesn't compile for me on ubuntu/dragonos unless i edit the file and remove "THIS_MODULE, ". Not sure if you're using latest 6.5 kernel yet or what you're working on there, but my experience is the opposite of yours...

@ImDroided
Copy link

ImDroided commented Jan 28, 2024

I can confirm that I was able to build with this mod on a Pi 5 with Ubuntu/DragonOS but get the same GPIOMEM error. Would not compile without.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants