Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lis3: use consistent naming of variables

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Witold Pilat <witold.pilat@gmail.com>
Cc: Lyall Pearce <lyall.pearce@hp.com>
Cc: Malte Starostik <m-starostik@versanet.de>
Cc: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Éric Piel and committed by
Linus Torvalds
d7f81d42 0021586b

+60 -60
+60 -60
drivers/misc/lis3lv02d/lis3lv02d.c
··· 833 833 } 834 834 EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs); 835 835 836 - static void lis3lv02d_8b_configure(struct lis3lv02d *dev, 836 + static void lis3lv02d_8b_configure(struct lis3lv02d *lis3, 837 837 struct lis3lv02d_platform_data *p) 838 838 { 839 839 int err; 840 840 int ctrl2 = p->hipass_ctrl; 841 841 842 842 if (p->click_flags) { 843 - dev->write(dev, CLICK_CFG, p->click_flags); 844 - dev->write(dev, CLICK_TIMELIMIT, p->click_time_limit); 845 - dev->write(dev, CLICK_LATENCY, p->click_latency); 846 - dev->write(dev, CLICK_WINDOW, p->click_window); 847 - dev->write(dev, CLICK_THSZ, p->click_thresh_z & 0xf); 848 - dev->write(dev, CLICK_THSY_X, 843 + lis3->write(lis3, CLICK_CFG, p->click_flags); 844 + lis3->write(lis3, CLICK_TIMELIMIT, p->click_time_limit); 845 + lis3->write(lis3, CLICK_LATENCY, p->click_latency); 846 + lis3->write(lis3, CLICK_WINDOW, p->click_window); 847 + lis3->write(lis3, CLICK_THSZ, p->click_thresh_z & 0xf); 848 + lis3->write(lis3, CLICK_THSY_X, 849 849 (p->click_thresh_x & 0xf) | 850 850 (p->click_thresh_y << 4)); 851 851 852 - if (dev->idev) { 852 + if (lis3->idev) { 853 853 struct input_dev *input_dev = lis3_dev.idev->input; 854 854 input_set_capability(input_dev, EV_KEY, BTN_X); 855 855 input_set_capability(input_dev, EV_KEY, BTN_Y); ··· 858 858 } 859 859 860 860 if (p->wakeup_flags) { 861 - dev->write(dev, FF_WU_CFG_1, p->wakeup_flags); 862 - dev->write(dev, FF_WU_THS_1, p->wakeup_thresh & 0x7f); 861 + lis3->write(lis3, FF_WU_CFG_1, p->wakeup_flags); 862 + lis3->write(lis3, FF_WU_THS_1, p->wakeup_thresh & 0x7f); 863 863 /* pdata value + 1 to keep this backward compatible*/ 864 - dev->write(dev, FF_WU_DURATION_1, p->duration1 + 1); 864 + lis3->write(lis3, FF_WU_DURATION_1, p->duration1 + 1); 865 865 ctrl2 ^= HP_FF_WU1; /* Xor to keep compatible with old pdata*/ 866 866 } 867 867 868 868 if (p->wakeup_flags2) { 869 - dev->write(dev, FF_WU_CFG_2, p->wakeup_flags2); 870 - dev->write(dev, FF_WU_THS_2, p->wakeup_thresh2 & 0x7f); 869 + lis3->write(lis3, FF_WU_CFG_2, p->wakeup_flags2); 870 + lis3->write(lis3, FF_WU_THS_2, p->wakeup_thresh2 & 0x7f); 871 871 /* pdata value + 1 to keep this backward compatible*/ 872 - dev->write(dev, FF_WU_DURATION_2, p->duration2 + 1); 872 + lis3->write(lis3, FF_WU_DURATION_2, p->duration2 + 1); 873 873 ctrl2 ^= HP_FF_WU2; /* Xor to keep compatible with old pdata*/ 874 874 } 875 875 /* Configure hipass filters */ 876 - dev->write(dev, CTRL_REG2, ctrl2); 876 + lis3->write(lis3, CTRL_REG2, ctrl2); 877 877 878 878 if (p->irq2) { 879 879 err = request_threaded_irq(p->irq2, ··· 891 891 * Initialise the accelerometer and the various subsystems. 892 892 * Should be rather independent of the bus system. 893 893 */ 894 - int lis3lv02d_init_device(struct lis3lv02d *dev) 894 + int lis3lv02d_init_device(struct lis3lv02d *lis3) 895 895 { 896 896 int err; 897 897 irq_handler_t thread_fn; 898 898 int irq_flags = 0; 899 899 900 - dev->whoami = lis3lv02d_read_8(dev, WHO_AM_I); 900 + lis3->whoami = lis3lv02d_read_8(lis3, WHO_AM_I); 901 901 902 - switch (dev->whoami) { 902 + switch (lis3->whoami) { 903 903 case WAI_12B: 904 904 pr_info("12 bits sensor found\n"); 905 - dev->read_data = lis3lv02d_read_12; 906 - dev->mdps_max_val = 2048; 907 - dev->pwron_delay = LIS3_PWRON_DELAY_WAI_12B; 908 - dev->odrs = lis3_12_rates; 909 - dev->odr_mask = CTRL1_DF0 | CTRL1_DF1; 910 - dev->scale = LIS3_SENSITIVITY_12B; 911 - dev->regs = lis3_wai12_regs; 912 - dev->regs_size = ARRAY_SIZE(lis3_wai12_regs); 905 + lis3->read_data = lis3lv02d_read_12; 906 + lis3->mdps_max_val = 2048; 907 + lis3->pwron_delay = LIS3_PWRON_DELAY_WAI_12B; 908 + lis3->odrs = lis3_12_rates; 909 + lis3->odr_mask = CTRL1_DF0 | CTRL1_DF1; 910 + lis3->scale = LIS3_SENSITIVITY_12B; 911 + lis3->regs = lis3_wai12_regs; 912 + lis3->regs_size = ARRAY_SIZE(lis3_wai12_regs); 913 913 break; 914 914 case WAI_8B: 915 915 pr_info("8 bits sensor found\n"); 916 - dev->read_data = lis3lv02d_read_8; 917 - dev->mdps_max_val = 128; 918 - dev->pwron_delay = LIS3_PWRON_DELAY_WAI_8B; 919 - dev->odrs = lis3_8_rates; 920 - dev->odr_mask = CTRL1_DR; 921 - dev->scale = LIS3_SENSITIVITY_8B; 922 - dev->regs = lis3_wai8_regs; 923 - dev->regs_size = ARRAY_SIZE(lis3_wai8_regs); 916 + lis3->read_data = lis3lv02d_read_8; 917 + lis3->mdps_max_val = 128; 918 + lis3->pwron_delay = LIS3_PWRON_DELAY_WAI_8B; 919 + lis3->odrs = lis3_8_rates; 920 + lis3->odr_mask = CTRL1_DR; 921 + lis3->scale = LIS3_SENSITIVITY_8B; 922 + lis3->regs = lis3_wai8_regs; 923 + lis3->regs_size = ARRAY_SIZE(lis3_wai8_regs); 924 924 break; 925 925 case WAI_3DC: 926 926 pr_info("8 bits 3DC sensor found\n"); 927 - dev->read_data = lis3lv02d_read_8; 928 - dev->mdps_max_val = 128; 929 - dev->pwron_delay = LIS3_PWRON_DELAY_WAI_8B; 930 - dev->odrs = lis3_3dc_rates; 931 - dev->odr_mask = CTRL1_ODR0|CTRL1_ODR1|CTRL1_ODR2|CTRL1_ODR3; 932 - dev->scale = LIS3_SENSITIVITY_8B; 927 + lis3->read_data = lis3lv02d_read_8; 928 + lis3->mdps_max_val = 128; 929 + lis3->pwron_delay = LIS3_PWRON_DELAY_WAI_8B; 930 + lis3->odrs = lis3_3dc_rates; 931 + lis3->odr_mask = CTRL1_ODR0|CTRL1_ODR1|CTRL1_ODR2|CTRL1_ODR3; 932 + lis3->scale = LIS3_SENSITIVITY_8B; 933 933 break; 934 934 default: 935 - pr_err("unknown sensor type 0x%X\n", dev->whoami); 935 + pr_err("unknown sensor type 0x%X\n", lis3->whoami); 936 936 return -EINVAL; 937 937 } 938 938 939 - dev->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs), 939 + lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs), 940 940 sizeof(lis3_wai12_regs)), GFP_KERNEL); 941 941 942 - if (dev->reg_cache == NULL) { 942 + if (lis3->reg_cache == NULL) { 943 943 printk(KERN_ERR DRIVER_NAME "out of memory\n"); 944 944 return -ENOMEM; 945 945 } 946 946 947 - mutex_init(&dev->mutex); 948 - atomic_set(&dev->wake_thread, 0); 947 + mutex_init(&lis3->mutex); 948 + atomic_set(&lis3->wake_thread, 0); 949 949 950 - lis3lv02d_add_fs(dev); 951 - err = lis3lv02d_poweron(dev); 950 + lis3lv02d_add_fs(lis3); 951 + err = lis3lv02d_poweron(lis3); 952 952 if (err) { 953 - lis3lv02d_remove_fs(dev); 953 + lis3lv02d_remove_fs(lis3); 954 954 return err; 955 955 } 956 956 957 - if (dev->pm_dev) { 958 - pm_runtime_set_active(dev->pm_dev); 959 - pm_runtime_enable(dev->pm_dev); 957 + if (lis3->pm_dev) { 958 + pm_runtime_set_active(lis3->pm_dev); 959 + pm_runtime_enable(lis3->pm_dev); 960 960 } 961 961 962 962 if (lis3lv02d_joystick_enable()) ··· 964 964 965 965 /* passing in platform specific data is purely optional and only 966 966 * used by the SPI transport layer at the moment */ 967 - if (dev->pdata) { 968 - struct lis3lv02d_platform_data *p = dev->pdata; 967 + if (lis3->pdata) { 968 + struct lis3lv02d_platform_data *p = lis3->pdata; 969 969 970 - if (dev->whoami == WAI_8B) 971 - lis3lv02d_8b_configure(dev, p); 970 + if (lis3->whoami == WAI_8B) 971 + lis3lv02d_8b_configure(lis3, p); 972 972 973 973 irq_flags = p->irq_flags1 & IRQF_TRIGGER_MASK; 974 974 975 - dev->irq_cfg = p->irq_cfg; 975 + lis3->irq_cfg = p->irq_cfg; 976 976 if (p->irq_cfg) 977 - dev->write(dev, CTRL_REG3, p->irq_cfg); 977 + lis3->write(lis3, CTRL_REG3, p->irq_cfg); 978 978 979 979 if (p->default_rate) 980 980 lis3lv02d_set_odr(p->default_rate); 981 981 } 982 982 983 983 /* bail if we did not get an IRQ from the bus layer */ 984 - if (!dev->irq) { 984 + if (!lis3->irq) { 985 985 pr_debug("No IRQ. Disabling /dev/freefall\n"); 986 986 goto out; 987 987 } ··· 997 997 * io-apic is not configurable (and generates a warning) but I keep it 998 998 * in case of support for other hardware. 999 999 */ 1000 - if (dev->pdata && dev->whoami == WAI_8B) 1000 + if (lis3->pdata && lis3->whoami == WAI_8B) 1001 1001 thread_fn = lis302dl_interrupt_thread1_8b; 1002 1002 else 1003 1003 thread_fn = NULL; 1004 1004 1005 - err = request_threaded_irq(dev->irq, lis302dl_interrupt, 1005 + err = request_threaded_irq(lis3->irq, lis302dl_interrupt, 1006 1006 thread_fn, 1007 1007 IRQF_TRIGGER_RISING | IRQF_ONESHOT | 1008 1008 irq_flags,