Skip to content

Commit d7f81d4

Browse files
pielerictorvalds
authored andcommitted
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>
1 parent 0021586 commit d7f81d4

1 file changed

Lines changed: 60 additions & 60 deletions

File tree

‎drivers/misc/lis3lv02d/lis3lv02d.c‎

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -833,23 +833,23 @@ int lis3lv02d_remove_fs(struct lis3lv02d *lis3)
833833
}
834834
EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs);
835835

836-
static void lis3lv02d_8b_configure(struct lis3lv02d *dev,
836+
static void lis3lv02d_8b_configure(struct lis3lv02d *lis3,
837837
struct lis3lv02d_platform_data *p)
838838
{
839839
int err;
840840
int ctrl2 = p->hipass_ctrl;
841841

842842
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,
849849
(p->click_thresh_x & 0xf) |
850850
(p->click_thresh_y << 4));
851851

852-
if (dev->idev) {
852+
if (lis3->idev) {
853853
struct input_dev *input_dev = lis3_dev.idev->input;
854854
input_set_capability(input_dev, EV_KEY, BTN_X);
855855
input_set_capability(input_dev, EV_KEY, BTN_Y);
@@ -858,22 +858,22 @@ static void lis3lv02d_8b_configure(struct lis3lv02d *dev,
858858
}
859859

860860
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);
863863
/* 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);
865865
ctrl2 ^= HP_FF_WU1; /* Xor to keep compatible with old pdata*/
866866
}
867867

868868
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);
871871
/* 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);
873873
ctrl2 ^= HP_FF_WU2; /* Xor to keep compatible with old pdata*/
874874
}
875875
/* Configure hipass filters */
876-
dev->write(dev, CTRL_REG2, ctrl2);
876+
lis3->write(lis3, CTRL_REG2, ctrl2);
877877

878878
if (p->irq2) {
879879
err = request_threaded_irq(p->irq2,
@@ -891,97 +891,97 @@ static void lis3lv02d_8b_configure(struct lis3lv02d *dev,
891891
* Initialise the accelerometer and the various subsystems.
892892
* Should be rather independent of the bus system.
893893
*/
894-
int lis3lv02d_init_device(struct lis3lv02d *dev)
894+
int lis3lv02d_init_device(struct lis3lv02d *lis3)
895895
{
896896
int err;
897897
irq_handler_t thread_fn;
898898
int irq_flags = 0;
899899

900-
dev->whoami = lis3lv02d_read_8(dev, WHO_AM_I);
900+
lis3->whoami = lis3lv02d_read_8(lis3, WHO_AM_I);
901901

902-
switch (dev->whoami) {
902+
switch (lis3->whoami) {
903903
case WAI_12B:
904904
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);
913913
break;
914914
case WAI_8B:
915915
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);
924924
break;
925925
case WAI_3DC:
926926
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;
933933
break;
934934
default:
935-
pr_err("unknown sensor type 0x%X\n", dev->whoami);
935+
pr_err("unknown sensor type 0x%X\n", lis3->whoami);
936936
return -EINVAL;
937937
}
938938

939-
dev->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
939+
lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
940940
sizeof(lis3_wai12_regs)), GFP_KERNEL);
941941

942-
if (dev->reg_cache == NULL) {
942+
if (lis3->reg_cache == NULL) {
943943
printk(KERN_ERR DRIVER_NAME "out of memory\n");
944944
return -ENOMEM;
945945
}
946946

947-
mutex_init(&dev->mutex);
948-
atomic_set(&dev->wake_thread, 0);
947+
mutex_init(&lis3->mutex);
948+
atomic_set(&lis3->wake_thread, 0);
949949

950-
lis3lv02d_add_fs(dev);
951-
err = lis3lv02d_poweron(dev);
950+
lis3lv02d_add_fs(lis3);
951+
err = lis3lv02d_poweron(lis3);
952952
if (err) {
953-
lis3lv02d_remove_fs(dev);
953+
lis3lv02d_remove_fs(lis3);
954954
return err;
955955
}
956956

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);
960960
}
961961

962962
if (lis3lv02d_joystick_enable())
963963
pr_err("joystick initialization failed\n");
964964

965965
/* passing in platform specific data is purely optional and only
966966
* 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;
969969

970-
if (dev->whoami == WAI_8B)
971-
lis3lv02d_8b_configure(dev, p);
970+
if (lis3->whoami == WAI_8B)
971+
lis3lv02d_8b_configure(lis3, p);
972972

973973
irq_flags = p->irq_flags1 & IRQF_TRIGGER_MASK;
974974

975-
dev->irq_cfg = p->irq_cfg;
975+
lis3->irq_cfg = p->irq_cfg;
976976
if (p->irq_cfg)
977-
dev->write(dev, CTRL_REG3, p->irq_cfg);
977+
lis3->write(lis3, CTRL_REG3, p->irq_cfg);
978978

979979
if (p->default_rate)
980980
lis3lv02d_set_odr(p->default_rate);
981981
}
982982

983983
/* bail if we did not get an IRQ from the bus layer */
984-
if (!dev->irq) {
984+
if (!lis3->irq) {
985985
pr_debug("No IRQ. Disabling /dev/freefall\n");
986986
goto out;
987987
}
@@ -997,12 +997,12 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
997997
* io-apic is not configurable (and generates a warning) but I keep it
998998
* in case of support for other hardware.
999999
*/
1000-
if (dev->pdata && dev->whoami == WAI_8B)
1000+
if (lis3->pdata && lis3->whoami == WAI_8B)
10011001
thread_fn = lis302dl_interrupt_thread1_8b;
10021002
else
10031003
thread_fn = NULL;
10041004

1005-
err = request_threaded_irq(dev->irq, lis302dl_interrupt,
1005+
err = request_threaded_irq(lis3->irq, lis302dl_interrupt,
10061006
thread_fn,
10071007
IRQF_TRIGGER_RISING | IRQF_ONESHOT |
10081008
irq_flags,

0 commit comments

Comments
 (0)