From baf0c461b50e92264b18feb24ae3b4c39f20f27f Mon Sep 17 00:00:00 2001 From: Stefan Briesenick Date: Mon, 8 Jan 2007 20:29:10 +0000 Subject: added patch for kernel 2.6.18 and later. (Portage version: 2.1.2_rc4-r7) --- sys-apps/pcfclock/files/digest-pcfclock-0.44-r3 | 3 + .../files/pcfclock-0.44-kernel-2.6.18.diff | 100 +++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 sys-apps/pcfclock/files/digest-pcfclock-0.44-r3 create mode 100644 sys-apps/pcfclock/files/pcfclock-0.44-kernel-2.6.18.diff (limited to 'sys-apps/pcfclock/files') diff --git a/sys-apps/pcfclock/files/digest-pcfclock-0.44-r3 b/sys-apps/pcfclock/files/digest-pcfclock-0.44-r3 new file mode 100644 index 000000000000..3e2aa335b8de --- /dev/null +++ b/sys-apps/pcfclock/files/digest-pcfclock-0.44-r3 @@ -0,0 +1,3 @@ +MD5 35f436caf4e6adb077b72bb49d5af3bb pcfclock-0.44.tar.gz 89914 +RMD160 e6bf6bafcf985d3742767118abc83c0fbf81252f pcfclock-0.44.tar.gz 89914 +SHA256 1285c9536ad04c74bbdd92e22fd6a6661feeb3c9175eccb9b1e02c2f06adbda8 pcfclock-0.44.tar.gz 89914 diff --git a/sys-apps/pcfclock/files/pcfclock-0.44-kernel-2.6.18.diff b/sys-apps/pcfclock/files/pcfclock-0.44-kernel-2.6.18.diff new file mode 100644 index 000000000000..2ac0c44b6362 --- /dev/null +++ b/sys-apps/pcfclock/files/pcfclock-0.44-kernel-2.6.18.diff @@ -0,0 +1,100 @@ +diff -Naur linux.orig/pcfclock.c linux/pcfclock.c +--- linux.orig/pcfclock.c 2004-05-17 18:26:12.000000000 +0200 ++++ linux/pcfclock.c 2007-01-08 21:16:44.000000000 +0100 +@@ -49,13 +49,18 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + #include ++#endif + #include + #include + #include + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + #include + #endif ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) ++#include ++#endif + + #include + #include +@@ -93,6 +98,26 @@ + + static struct pcfclock_struct pcfclock_table[PCFCLOCK_NO]; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) ++# define CLASS_CREATE(owner, name) class_create(owner, name) ++# define CLASS_DESTROY(class) class_destroy(class) ++# define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) class_device_create(class, NULL, dev, device, fmt, rest) ++# define CLASS_DEVICE_DESTROY(class, dev) class_device_destroy(class, dev) ++static struct class *pcfclock_class; ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) ++# define CLASS_CREATE(owner, name) class_create(owner, name) ++# define CLASS_DESTROY(class) class_destroy(class) ++# define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) class_device_create(class, dev, device, fmt, rest) ++# define CLASS_DEVICE_DESTROY(class, dev) class_device_destroy(class, dev) ++static struct class *pcfclock_class; ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) ++# define CLASS_CREATE(owner, name) class_simple_create(owner, name) ++# define CLASS_DESTROY(class) class_simple_destroy(class) ++# define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) class_simple_device_add(class, dev, device, fmt, rest) ++# define CLASS_DEVICE_DESTROY(class, dev) class_simple_device_remove(dev) ++static struct class_simple *pcfclock_class; ++#endif ++ + /* + * The radio clock transmits data only to the PC when requested. While the + * time signal is received for the first time no communication between the PC +@@ -401,7 +426,11 @@ + static int parport_nr[PCFCLOCK_NO] = {[0 ... PCFCLOCK_NO - 1] = PCFCLOCK_PARPORT_UNSPEC }; + static char *parport[PCFCLOCK_NO] = { NULL, }; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) ++module_param_array(parport, charp, NULL, 0); ++#else + MODULE_PARM(parport, "1-" __MODULE_STRING(PCFCLOCK_NO) "s"); ++#endif + + #ifndef MODULE + static int __init +@@ -442,7 +471,10 @@ + return 1; + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) ++ CLASS_DEVICE_CREATE(pcfclock_class, MKDEV(PCFCLOCK_MAJOR, n), NULL, "pcfclock%d", n); ++# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + devfs_mk_cdev(MKDEV(PCFCLOCK_MAJOR, n), S_IFCHR | S_IRUGO, "pcfclocks/%d", n); ++# endif + #else + sprintf(name, "%d", n); + devfs_register(devfs_handle, name, DEVFS_FL_DEFAULT, PCFCLOCK_MAJOR, n, S_IFCHR | S_IRUGO, +@@ -509,7 +541,10 @@ + printk(KERN_ERR "pcfclock: unable to get major %d\n", PCFCLOCK_MAJOR); + return -EIO; + } ++ pcfclock_class = CLASS_CREATE(THIS_MODULE, "pcfclock"); ++# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + devfs_mk_dir("pcfclocks"); ++# endif + #else + if (devfs_register_chrdev(PCFCLOCK_MAJOR, "pcfclock", &pcfclock_fops)) { + printk(KERN_ERR "pcfclock: unable to get major %d\n", PCFCLOCK_MAJOR); +@@ -563,10 +598,16 @@ + for (n = 0; n < PCFCLOCK_NO; n++) { + if (pcfclock_table[n].dev != NULL) { + parport_unregister_device(pcfclock_table[n].dev); ++ CLASS_DEVICE_DESTROY(pcfclock_class, MKDEV(PCFCLOCK_MAJOR, n)); ++# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + devfs_remove("pcfclocks/%d", n); ++# endif + } + } ++ CLASS_DESTROY(pcfclock_class); ++# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + devfs_remove("pcfclocks"); ++# endif + #else + devfs_unregister(devfs_handle); + devfs_unregister_chrdev(PCFCLOCK_MAJOR, "pcfclock"); -- cgit v1.2.3-65-gdbad