On Tue, Feb 25, 2025 at 10:48:53AM +0000, Aditya Garg wrote:
...On 25 Feb 2025, at 4:17 PM, andriy.shevchenko@xxxxxxxxxxxxxxx wrote:
On Tue, Feb 25, 2025 at 10:36:03AM +0000, Aditya Garg wrote:
On 25 Feb 2025, at 4:03 PM, andriy.shevchenko@xxxxxxxxxxxxxxx wrote:On Tue, Feb 25, 2025 at 10:09:42AM +0000, Aditya Garg wrote:
Sure. I also want him to clarify my question about potential drm_err_probe().I'm kinda stuck between contrasting views of 2 kernel maintainers lol,It's a macro.I'm not sure how drm_err works,+static int appletbdrm_probe(struct usb_interface *intf,This is simply wrong (and in this case even lead to crash in some circumstances).
+ const struct usb_device_id *id)
+{
+ struct usb_endpoint_descriptor *bulk_in, *bulk_out;
+ struct device *dev = &intf->dev;
+ struct appletbdrm_device *adev;
+ struct drm_device *drm;
+ int ret;
+
+ ret = usb_find_common_endpoints(intf->cur_altsetting, &bulk_in, &bulk_out, NULL, NULL);
+ if (ret) {
+ drm_err(drm, "Failed to find bulk endpoints\n");
drm_err() may not be used here. That's my point in previous discussions.
Independently on the subsystem the ->probe() for the sake of consistency and
being informative should only rely on struct device *dev,
but struct drm_device does have a struct device *dev as well.Yes, but only when it's initialized.
Anyways, this is something I'll leave for Thomas to reply.The code above is wrong independently on his reply :-)
so I said let Thomas reply.