Mercurial > pt1.oyama
comparison driver/pt1_pci.c @ 179:ac23a9b417a2
Support Linux kernel version >= 3.8
Add ld opt -lm
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Fri, 03 May 2013 11:00:11 +0900 |
parents | 4303bbfd5d37 |
children |
comparison
equal
deleted
inserted
replaced
178:a0bc3700a496 | 179:ac23a9b417a2 |
---|---|
44 #include "pt1_i2c.h" | 44 #include "pt1_i2c.h" |
45 #include "pt1_tuner_data.h" | 45 #include "pt1_tuner_data.h" |
46 #include "pt1_ioctl.h" | 46 #include "pt1_ioctl.h" |
47 | 47 |
48 /* These identify the driver base version and may not be removed. */ | 48 /* These identify the driver base version and may not be removed. */ |
49 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) | |
49 static char version[] __devinitdata = | 50 static char version[] __devinitdata = |
51 #else | |
52 static char version[] = | |
53 #endif | |
50 DRV_NAME ".c: " DRV_VERSION " " DRV_RELDATE " \n"; | 54 DRV_NAME ".c: " DRV_VERSION " " DRV_RELDATE " \n"; |
51 | 55 |
52 MODULE_AUTHOR("Tomoaki Ishikawa tomy@users.sourceforge.jp and Yoshiki Yazawa yaz@honeyplanet.jp"); | 56 MODULE_AUTHOR("Tomoaki Ishikawa tomy@users.sourceforge.jp and Yoshiki Yazawa yaz@honeyplanet.jp"); |
53 #define DRIVER_DESC "PCI earthsoft PT1/2 driver" | 57 #define DRIVER_DESC "PCI earthsoft PT1/2 driver" |
54 MODULE_DESCRIPTION(DRIVER_DESC); | 58 MODULE_DESCRIPTION(DRIVER_DESC); |
686 } | 690 } |
687 } | 691 } |
688 } | 692 } |
689 return 0 ; | 693 return 0 ; |
690 } | 694 } |
695 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) | |
691 static int __devinit pt1_pci_init_one (struct pci_dev *pdev, | 696 static int __devinit pt1_pci_init_one (struct pci_dev *pdev, |
697 #else | |
698 static int pt1_pci_init_one (struct pci_dev *pdev, | |
699 #endif | |
692 const struct pci_device_id *ent) | 700 const struct pci_device_id *ent) |
693 { | 701 { |
694 int rc ; | 702 int rc ; |
695 int lp ; | 703 int lp ; |
696 int minor ; | 704 int minor ; |
912 out_err_regbase: | 920 out_err_regbase: |
913 return -EIO; | 921 return -EIO; |
914 | 922 |
915 } | 923 } |
916 | 924 |
925 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) | |
917 static void __devexit pt1_pci_remove_one(struct pci_dev *pdev) | 926 static void __devexit pt1_pci_remove_one(struct pci_dev *pdev) |
927 #else | |
928 static void pt1_pci_remove_one(struct pci_dev *pdev) | |
929 #endif | |
918 { | 930 { |
919 | 931 |
920 int lp ; | 932 int lp ; |
921 __u32 val ; | 933 __u32 val ; |
922 PT1_DEVICE *dev_conf = (PT1_DEVICE *)pci_get_drvdata(pdev); | 934 PT1_DEVICE *dev_conf = (PT1_DEVICE *)pci_get_drvdata(pdev); |
979 | 991 |
980 | 992 |
981 static struct pci_driver pt1_driver = { | 993 static struct pci_driver pt1_driver = { |
982 .name = DRV_NAME, | 994 .name = DRV_NAME, |
983 .probe = pt1_pci_init_one, | 995 .probe = pt1_pci_init_one, |
996 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) | |
984 .remove = __devexit_p(pt1_pci_remove_one), | 997 .remove = __devexit_p(pt1_pci_remove_one), |
998 #else | |
999 .remove = pt1_pci_remove_one, | |
1000 #endif | |
985 .id_table = pt1_pci_tbl, | 1001 .id_table = pt1_pci_tbl, |
986 #ifdef CONFIG_PM | 1002 #ifdef CONFIG_PM |
987 .suspend = pt1_pci_suspend, | 1003 .suspend = pt1_pci_suspend, |
988 .resume = pt1_pci_resume, | 1004 .resume = pt1_pci_resume, |
989 #endif /* CONFIG_PM */ | 1005 #endif /* CONFIG_PM */ |