Skip to content

Commit 91fff6f

Browse files
committed
Merge tag 'staging-6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fixes from Greg KH: "Here are some small staging driver fixes that resolve some reported issues and have been in my tree for too long due to the holiday break. They resolve the following issues: - lots of gpib build-time fixes as reported by testers and 0-day - gpib logical fixes - mailmap fix All of these have been in linux-next for a while, with no reported issues other than the duplicated change" * tag 'staging-6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: gpib: mite: remove unused global functions staging: gpib: refer to correct config symbol in tnt4882 Makefile mailmap: update Bingwu Zhang's email address staging: gpib: fix address space mixup staging: gpib: use ioport_map staging: gpib: fix pcmcia dependencies staging: gpib: add module author and description fields staging: gpib: fix Makefiles staging: gpib: make global 'usec_diff' functions static staging: gpib: Modify mismatched function name staging: gpib: Add lower bound check for secondary address staging: gpib: Fix erroneous removal of blank before newline
2 parents 4bd9e3b + 6f79db0 commit 91fff6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+165
-295
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ Ben Widawsky <[email protected]> <[email protected]>
121121
122122
Benjamin Tissoires <[email protected]> <[email protected]>
123123
Benjamin Tissoires <[email protected]> <[email protected]>
124+
125+
124126
125127
126128

drivers/staging/gpib/Kconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ config GPIB_NI_PCI_ISA
6565
depends on ISA_BUS || PCI || PCMCIA
6666
depends on HAS_IOPORT
6767
depends on !X86_PAE
68+
depends on PCMCIA || !PCMCIA
69+
depends on HAS_IOPORT_MAP
6870
select GPIB_COMMON
6971
select GPIB_NEC7210
7072
help
@@ -89,6 +91,7 @@ config GPIB_CB7210
8991
depends on HAS_IOPORT
9092
depends on ISA_BUS || PCI || PCMCIA
9193
depends on !X86_PAE
94+
depends on PCMCIA || !PCMCIA
9295
select GPIB_COMMON
9396
select GPIB_NEC7210
9497
help
@@ -177,6 +180,7 @@ config GPIB_HP82341
177180
config GPIB_INES
178181
tristate "INES"
179182
depends on PCI || ISA_BUS || PCMCIA
183+
depends on PCMCIA || !PCMCIA
180184
depends on HAS_IOPORT
181185
depends on !X86_PAE
182186
select GPIB_COMMON
@@ -199,8 +203,8 @@ config GPIB_INES
199203
called cb7210.
200204

201205
config GPIB_PCMCIA
202-
bool "PCMCIA/Cardbus support for NI MC and Ines boards"
203-
depends on PCCARD && (GPIB_NI_PCI_ISA || GPIB_CB7210 || GPIB_INES)
206+
def_bool y
207+
depends on PCMCIA && (GPIB_NI_PCI_ISA || GPIB_CB7210 || GPIB_INES)
204208
help
205209
Enable PCMCIA/CArdbus support for National Instruments,
206210
measurement computing boards and Ines boards.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
obj-m += agilent_82350b.o
2+
obj-$(CONFIG_GPIB_AGILENT_82350B) += agilent_82350b.o

drivers/staging/gpib/agilent_82350b/agilent_82350b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ static int agilent_82350b_generic_attach(gpib_board_t *board, const gpib_board_c
700700
GPIB_82350A_REGION));
701701
dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n",
702702
driver_name, a_priv->gpib_base);
703-
tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG;
703+
tms_priv->mmiobase = a_priv->gpib_base + TMS9914_BASE_REG;
704704
a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device,
705705
SRAM_82350A_REGION),
706706
pci_resource_len(a_priv->pci_device,
@@ -724,7 +724,7 @@ static int agilent_82350b_generic_attach(gpib_board_t *board, const gpib_board_c
724724
pci_resource_len(a_priv->pci_device, GPIB_REGION));
725725
dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n",
726726
driver_name, a_priv->gpib_base);
727-
tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG;
727+
tms_priv->mmiobase = a_priv->gpib_base + TMS9914_BASE_REG;
728728
a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device, SRAM_REGION),
729729
pci_resource_len(a_priv->pci_device, SRAM_REGION));
730730
dev_dbg(board->gpib_dev, "%s: sram base address remapped to 0x%p\n",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
obj-m += agilent_82357a.o
2+
obj-$(CONFIG_GPIB_AGILENT_82357A) += agilent_82357a.o
33

44

drivers/staging/gpib/cb7210/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ccflags-$(CONFIG_GPIB_PCMCIA) := -DGPIB_PCMCIA
2-
obj-m += cb7210.o
2+
obj-$(CONFIG_GPIB_CB7210) += cb7210.o
33

44

drivers/staging/gpib/cb7210/cb7210.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -971,12 +971,12 @@ int cb_pci_attach(gpib_board_t *board, const gpib_board_config_t *config)
971971
switch (cb_priv->pci_chip) {
972972
case PCI_CHIP_AMCC_S5933:
973973
cb_priv->amcc_iobase = pci_resource_start(cb_priv->pci_device, 0);
974-
nec_priv->iobase = (void *)(pci_resource_start(cb_priv->pci_device, 1));
974+
nec_priv->iobase = pci_resource_start(cb_priv->pci_device, 1);
975975
cb_priv->fifo_iobase = pci_resource_start(cb_priv->pci_device, 2);
976976
break;
977977
case PCI_CHIP_QUANCOM:
978-
nec_priv->iobase = (void *)(pci_resource_start(cb_priv->pci_device, 0));
979-
cb_priv->fifo_iobase = (unsigned long)nec_priv->iobase;
978+
nec_priv->iobase = pci_resource_start(cb_priv->pci_device, 0);
979+
cb_priv->fifo_iobase = nec_priv->iobase;
980980
break;
981981
default:
982982
pr_err("cb7210: bug! unhandled pci_chip=%i\n", cb_priv->pci_chip);
@@ -1040,8 +1040,8 @@ int cb_isa_attach(gpib_board_t *board, const gpib_board_config_t *config)
10401040
return retval;
10411041
cb_priv = board->private_data;
10421042
nec_priv = &cb_priv->nec7210_priv;
1043-
if (request_region((unsigned long)config->ibbase, cb7210_iosize, "cb7210") == 0) {
1044-
pr_err("gpib: ioports starting at 0x%p are already in use\n", config->ibbase);
1043+
if (request_region(config->ibbase, cb7210_iosize, "cb7210") == 0) {
1044+
pr_err("gpib: ioports starting at 0x%u are already in use\n", config->ibbase);
10451045
return -EIO;
10461046
}
10471047
nec_priv->iobase = config->ibbase;
@@ -1471,7 +1471,7 @@ int cb_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t *config)
14711471
(unsigned long)curr_dev->resource[0]->start);
14721472
return -EIO;
14731473
}
1474-
nec_priv->iobase = (void *)(unsigned long)curr_dev->resource[0]->start;
1474+
nec_priv->iobase = curr_dev->resource[0]->start;
14751475
cb_priv->fifo_iobase = curr_dev->resource[0]->start;
14761476

14771477
if (request_irq(curr_dev->irq, cb7210_interrupt, IRQF_SHARED,

drivers/staging/gpib/cb7210/cb7210.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ enum hs_regs {
113113
HS_STATUS = 0x8, /* HS_STATUS register */
114114
};
115115

116-
static inline unsigned long nec7210_iobase(const struct cb7210_priv *cb_priv)
116+
static inline u32 nec7210_iobase(const struct cb7210_priv *cb_priv)
117117
{
118-
return (unsigned long)(cb_priv->nec7210_priv.iobase);
118+
return cb_priv->nec7210_priv.iobase;
119119
}
120120

121121
static inline int cb7210_page_in_bits(unsigned int page)

drivers/staging/gpib/cec/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
obj-m += cec_gpib.o
2+
obj-$(CONFIG_GPIB_CEC_PCI) += cec_gpib.o
33

drivers/staging/gpib/cec/cec_gpib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ int cec_pci_attach(gpib_board_t *board, const gpib_board_config_t *config)
297297

298298
cec_priv->plx_iobase = pci_resource_start(cec_priv->pci_device, 1);
299299
pr_info(" plx9050 base address 0x%lx\n", cec_priv->plx_iobase);
300-
nec_priv->iobase = (void *)(pci_resource_start(cec_priv->pci_device, 3));
301-
pr_info(" nec7210 base address 0x%p\n", nec_priv->iobase);
300+
nec_priv->iobase = pci_resource_start(cec_priv->pci_device, 3);
301+
pr_info(" nec7210 base address 0x%x\n", nec_priv->iobase);
302302

303303
isr_flags |= IRQF_SHARED;
304304
if (request_irq(cec_priv->pci_device->irq, cec_interrupt, isr_flags, "pci-gpib", board)) {

drivers/staging/gpib/common/gpib_os.c

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -116,56 +116,6 @@ int io_timed_out(gpib_board_t *board)
116116
return 0;
117117
}
118118

119-
void writeb_wrapper(unsigned int value, void *address)
120-
{
121-
writeb(value, address);
122-
};
123-
EXPORT_SYMBOL(writeb_wrapper);
124-
125-
void writew_wrapper(unsigned int value, void *address)
126-
{
127-
writew(value, address);
128-
};
129-
EXPORT_SYMBOL(writew_wrapper);
130-
131-
unsigned int readb_wrapper(void *address)
132-
{
133-
return readb(address);
134-
};
135-
EXPORT_SYMBOL(readb_wrapper);
136-
137-
unsigned int readw_wrapper(void *address)
138-
{
139-
return readw(address);
140-
};
141-
EXPORT_SYMBOL(readw_wrapper);
142-
143-
#ifdef CONFIG_HAS_IOPORT
144-
void outb_wrapper(unsigned int value, void *address)
145-
{
146-
outb(value, (unsigned long)(address));
147-
};
148-
EXPORT_SYMBOL(outb_wrapper);
149-
150-
void outw_wrapper(unsigned int value, void *address)
151-
{
152-
outw(value, (unsigned long)(address));
153-
};
154-
EXPORT_SYMBOL(outw_wrapper);
155-
156-
unsigned int inb_wrapper(void *address)
157-
{
158-
return inb((unsigned long)(address));
159-
};
160-
EXPORT_SYMBOL(inb_wrapper);
161-
162-
unsigned int inw_wrapper(void *address)
163-
{
164-
return inw((unsigned long)(address));
165-
};
166-
EXPORT_SYMBOL(inw_wrapper);
167-
#endif
168-
169119
/* this is a function instead of a constant because of Suse
170120
* defining HZ to be a function call to get_hz()
171121
*/
@@ -536,7 +486,7 @@ int dvrsp(gpib_board_t *board, unsigned int pad, int sad,
536486
return -1;
537487
}
538488

539-
if (pad > MAX_GPIB_PRIMARY_ADDRESS || sad > MAX_GPIB_SECONDARY_ADDRESS) {
489+
if (pad > MAX_GPIB_PRIMARY_ADDRESS || sad > MAX_GPIB_SECONDARY_ADDRESS || sad < -1) {
540490
pr_err("gpib: bad address for serial poll");
541491
return -1;
542492
}
@@ -1623,7 +1573,7 @@ static int iobase_ioctl(gpib_board_config_t *config, unsigned long arg)
16231573

16241574
if (WARN_ON_ONCE(sizeof(void *) > sizeof(base_addr)))
16251575
return -EFAULT;
1626-
config->ibbase = (void *)(unsigned long)(base_addr);
1576+
config->ibbase = base_addr;
16271577

16281578
return 0;
16291579
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
obj-m += fluke_gpib.o
2+
obj-$(CONFIG_GPIB_FLUKE) += fluke_gpib.o
33

drivers/staging/gpib/eastwood/fluke_gpib.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,12 +1011,12 @@ static int fluke_attach_impl(gpib_board_t *board, const gpib_board_config_t *con
10111011
}
10121012
e_priv->gpib_iomem_res = res;
10131013

1014-
nec_priv->iobase = ioremap(e_priv->gpib_iomem_res->start,
1014+
nec_priv->mmiobase = ioremap(e_priv->gpib_iomem_res->start,
10151015
resource_size(e_priv->gpib_iomem_res));
1016-
pr_info("gpib: iobase %lx remapped to %p, length=%d\n",
1017-
(unsigned long)e_priv->gpib_iomem_res->start,
1018-
nec_priv->iobase, (int)resource_size(e_priv->gpib_iomem_res));
1019-
if (!nec_priv->iobase) {
1016+
pr_info("gpib: mmiobase %llx remapped to %p, length=%d\n",
1017+
(u64)e_priv->gpib_iomem_res->start,
1018+
nec_priv->mmiobase, (int)resource_size(e_priv->gpib_iomem_res));
1019+
if (!nec_priv->mmiobase) {
10201020
dev_err(&fluke_gpib_pdev->dev, "Could not map I/O memory\n");
10211021
return -ENOMEM;
10221022
}
@@ -1107,7 +1107,7 @@ void fluke_detach(gpib_board_t *board)
11071107
gpib_free_pseudo_irq(board);
11081108
nec_priv = &e_priv->nec7210_priv;
11091109

1110-
if (nec_priv->iobase) {
1110+
if (nec_priv->mmiobase) {
11111111
fluke_paged_write_byte(e_priv, 0, ISR0_IMR0, ISR0_IMR0_PAGE);
11121112
nec7210_board_reset(nec_priv, board);
11131113
}

drivers/staging/gpib/eastwood/fluke_gpib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ static inline uint8_t fluke_read_byte_nolock(struct nec7210_priv *nec_priv,
7272
{
7373
u8 retval;
7474

75-
retval = readl(nec_priv->iobase + register_num * nec_priv->offset);
75+
retval = readl(nec_priv->mmiobase + register_num * nec_priv->offset);
7676
return retval;
7777
}
7878

7979
// don't use without locking nec_priv->register_page_lock
8080
static inline void fluke_write_byte_nolock(struct nec7210_priv *nec_priv, uint8_t data,
8181
int register_num)
8282
{
83-
writel(data, nec_priv->iobase + register_num * nec_priv->offset);
83+
writel(data, nec_priv->mmiobase + register_num * nec_priv->offset);
8484
}
8585

8686
static inline uint8_t fluke_paged_read_byte(struct fluke_priv *e_priv,

drivers/staging/gpib/fmh_gpib/fmh_gpib.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <linux/slab.h>
2525

2626
MODULE_LICENSE("GPL");
27+
MODULE_DESCRIPTION("GPIB Driver for fmh_gpib_core");
28+
MODULE_AUTHOR("Frank Mori Hess <[email protected]>");
2729

2830
static irqreturn_t fmh_gpib_interrupt(int irq, void *arg);
2931
static int fmh_gpib_attach_holdoff_all(gpib_board_t *board, const gpib_board_config_t *config);
@@ -1419,15 +1421,14 @@ static int fmh_gpib_attach_impl(gpib_board_t *board, const gpib_board_config_t *
14191421
}
14201422
e_priv->gpib_iomem_res = res;
14211423

1422-
nec_priv->iobase = ioremap(e_priv->gpib_iomem_res->start,
1424+
nec_priv->mmiobase = ioremap(e_priv->gpib_iomem_res->start,
14231425
resource_size(e_priv->gpib_iomem_res));
1424-
if (!nec_priv->iobase) {
1426+
if (!nec_priv->mmiobase) {
14251427
dev_err(board->dev, "Could not map I/O memory for gpib\n");
14261428
return -ENOMEM;
14271429
}
1428-
dev_info(board->dev, "iobase 0x%lx remapped to %p, length=%ld\n",
1429-
(unsigned long)e_priv->gpib_iomem_res->start,
1430-
nec_priv->iobase, (unsigned long)resource_size(e_priv->gpib_iomem_res));
1430+
dev_info(board->dev, "iobase %pr remapped to %p\n",
1431+
e_priv->gpib_iomem_res, nec_priv->mmiobase);
14311432

14321433
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma_fifos");
14331434
if (!res) {
@@ -1507,14 +1508,14 @@ void fmh_gpib_detach(gpib_board_t *board)
15071508
free_irq(e_priv->irq, board);
15081509
if (e_priv->fifo_base)
15091510
fifos_write(e_priv, 0, FIFO_CONTROL_STATUS_REG);
1510-
if (nec_priv->iobase) {
1511+
if (nec_priv->mmiobase) {
15111512
write_byte(nec_priv, 0, ISR0_IMR0_REG);
15121513
nec7210_board_reset(nec_priv, board);
15131514
}
15141515
if (e_priv->fifo_base)
15151516
iounmap(e_priv->fifo_base);
1516-
if (nec_priv->iobase)
1517-
iounmap(nec_priv->iobase);
1517+
if (nec_priv->mmiobase)
1518+
iounmap(nec_priv->mmiobase);
15181519
if (e_priv->dma_port_res) {
15191520
release_mem_region(e_priv->dma_port_res->start,
15201521
resource_size(e_priv->dma_port_res));
@@ -1564,12 +1565,12 @@ static int fmh_gpib_pci_attach_impl(gpib_board_t *board, const gpib_board_config
15641565
e_priv->gpib_iomem_res = &pci_device->resource[gpib_control_status_pci_resource_index];
15651566
e_priv->dma_port_res = &pci_device->resource[gpib_fifo_pci_resource_index];
15661567

1567-
nec_priv->iobase = ioremap(pci_resource_start(pci_device,
1568+
nec_priv->mmiobase = ioremap(pci_resource_start(pci_device,
15681569
gpib_control_status_pci_resource_index),
15691570
pci_resource_len(pci_device,
15701571
gpib_control_status_pci_resource_index));
15711572
dev_info(board->dev, "base address for gpib control/status registers remapped to 0x%p\n",
1572-
nec_priv->iobase);
1573+
nec_priv->mmiobase);
15731574

15741575
if (e_priv->dma_port_res->flags & IORESOURCE_MEM) {
15751576
e_priv->fifo_base = ioremap(pci_resource_start(pci_device,
@@ -1632,14 +1633,14 @@ void fmh_gpib_pci_detach(gpib_board_t *board)
16321633
free_irq(e_priv->irq, board);
16331634
if (e_priv->fifo_base)
16341635
fifos_write(e_priv, 0, FIFO_CONTROL_STATUS_REG);
1635-
if (nec_priv->iobase) {
1636+
if (nec_priv->mmiobase) {
16361637
write_byte(nec_priv, 0, ISR0_IMR0_REG);
16371638
nec7210_board_reset(nec_priv, board);
16381639
}
16391640
if (e_priv->fifo_base)
16401641
iounmap(e_priv->fifo_base);
1641-
if (nec_priv->iobase)
1642-
iounmap(nec_priv->iobase);
1642+
if (nec_priv->mmiobase)
1643+
iounmap(nec_priv->mmiobase);
16431644
if (e_priv->dma_port_res || e_priv->gpib_iomem_res)
16441645
pci_release_regions(to_pci_dev(board->dev));
16451646
if (board->dev)

drivers/staging/gpib/fmh_gpib/fmh_gpib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ static const unsigned int fifo_max_burst_length_mask = 0x00ff;
127127
static inline uint8_t gpib_cs_read_byte(struct nec7210_priv *nec_priv,
128128
unsigned int register_num)
129129
{
130-
return readb(nec_priv->iobase + register_num * nec_priv->offset);
130+
return readb(nec_priv->mmiobase + register_num * nec_priv->offset);
131131
}
132132

133133
static inline void gpib_cs_write_byte(struct nec7210_priv *nec_priv, uint8_t data,
134134
unsigned int register_num)
135135
{
136-
writeb(data, nec_priv->iobase + register_num * nec_priv->offset);
136+
writeb(data, nec_priv->mmiobase + register_num * nec_priv->offset);
137137
}
138138

139139
static inline uint16_t fifos_read(struct fmh_priv *fmh_priv, int register_num)

drivers/staging/gpib/gpio/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
obj-m += gpib_bitbang.o
2+
obj-$(CONFIG_GPIB_GPIO) += gpib_bitbang.o
33

44

drivers/staging/gpib/gpio/gpib_bitbang.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ struct bb_priv {
315315
enum listener_function_state listener_state;
316316
};
317317

318-
inline long usec_diff(struct timespec64 *a, struct timespec64 *b);
318+
static inline long usec_diff(struct timespec64 *a, struct timespec64 *b);
319319
static void bb_buffer_print(unsigned char *buffer, size_t length, int cmd, int eoi);
320320
static void set_data_lines(u8 byte);
321321
static u8 get_data_lines(void);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
obj-m += hp82335.o
2+
obj-$(CONFIG_GPIB_HP82335) += hp82335.o
33

44

0 commit comments

Comments
 (0)