From: Greg KH <greg@kroah.com>
To: Michael Hunold <hunold@convergence.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] Add two drivers for USB based DVB-T adapters
Date: Tue, 15 Jul 2003 14:20:05 -0700 [thread overview]
Message-ID: <20030715212005.GA5458@kroah.com> (raw)
In-Reply-To: <10582891731946@convergence.de>
On Tue, Jul 15, 2003 at 07:12:53PM +0200, Michael Hunold wrote:
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
> +static void *ttusb_probe(struct usb_device *udev, unsigned int ifnum,
> + const struct usb_device_id *id)
> +{
> + struct ttusb *ttusb;
> + int result, channel;
> +
> + if (ifnum != 0)
> + return NULL;
> +
> + dprintk("%s: TTUSB DVB connected\n", __FUNCTION__);
> +
> + if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL)))
> + return NULL;
> +
> +#else
> +static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
> +{
> + struct usb_device *udev;
> + struct ttusb *ttusb;
> + int result, channel;
> +
> + dprintk("%s: TTUSB DVB connected\n", __FUNCTION__);
> +
> + udev = interface_to_usbdev(intf);
> +
> + if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL)))
> + return -ENOMEM;
> +
> +#endif
Ick, you don't really want to try to support all of the USB changes in
the same driver, now do you? Why not just live with two different
drivers.
The ALSA people eventually gave up trying to do this... :)
> +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69))
> +#undef devfs_remove
> +#define devfs_remove(x) devfs_unregister(ttusb->stc_devfs_handle);
> +#endif
> +#if 0
> + devfs_remove(TTUSB_BUDGET_NAME);
> +#endif
You end up with crud like this because of trying to support old kernels.
Why do you care about kernels prior to 2.5.69? If so, your USB kernel
checks are wrong, as 2.5.0 didn't have those API changes :)
thanks,
greg k-h
next prev parent reply other threads:[~2003-07-15 21:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-15 17:12 [PATCH 1/1] Add two drivers for USB based DVB-T adapters Michael Hunold
2003-07-15 21:20 ` Greg KH [this message]
2003-07-18 6:24 ` Michael Hunold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030715212005.GA5458@kroah.com \
--to=greg@kroah.com \
--cc=hunold@convergence.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox