Skip to content

Commit 1641684

Browse files
committed
Merge tag 'staging-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging updates from Greg KH: "Here is the "big" set of staging driver changes for 6.17-rc1. That's in quotes as it really isn't all that big of a set of changes this development cycle at all. Major things that stand out are: - gpib cleanups and tweaks with the majority of the big issues now taken care of. Odds are it will move out of staging/ in the next merge window if all goes well. - more constant cleanups and layer removals from the rtl8723bs driver. It's amazing how many layers deep they really are, all cleanups here are great to see - axis-fifo sysfs api removed and debugfs api added. The sysfs api didn't work at all so obviously no one was using it. Add the same information into debugfs as that's the proper place for it, and make it actually work. - Remaining changes is lots of small checkpatch cleanups, most of which seem to have come from a Debconf session where people were encouraged to submit their first kernel patch, a nice thing to see happen again. All of these have been in linux-next with no reported issues" * tag 'staging-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (71 commits) staging: rtl8723bs: remove redundant semicolon in basic_types.h staging: gpib: Add init response codes for new ni-usb-hs+ staging: rtl8723bs: DoIQK_8723B is empty staging: rtl8723bs: dm_CheckStatistics is empty staging: rtl8723bs: hw_var_port_switch is empty staging: rtl8723bs: _InitOtherVariable is empty staging: rtl8723bs: rtw_get_encrypt_decrypt_from_registrypriv is empty staging: rtl8723bs: rtl8723b_set_FwAoacRsvdPage_cmd is empty staging: rtl8723bs: CheckFwRsvdPageContent is empty staging: rtl8723bs: clean up redundant & parentheses staging: axis-fifo: add debugfs interface for dumping fifo registers staging: axis-fifo: remove sysfs interface staging: nvec: Fix incorrect null termination of battery manufacturer staging: gpib: fix typo staging: sm750fb: fix CamelCase variable naming staging: vme_user: fix spelling errors staging: rtl8723bs: remove unnecessary braces in rtl8723b_cmd staging: rtl8723bs: remove unnecessary commented code staging: rtl8723bs: add missing blank line after declaration staging: rtl8723bs: remove unnecessary comment separator lines ...
2 parents 0d5ec79 + 63533ba commit 1641684

Some content is hidden

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

57 files changed

+425
-924
lines changed

drivers/staging/axis-fifo/axis-fifo.c

Lines changed: 41 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <linux/uaccess.h>
3434
#include <linux/jiffies.h>
3535
#include <linux/miscdevice.h>
36+
#include <linux/debugfs.h>
3637

3738
/* ----------------------------
3839
* driver parameters
@@ -44,6 +45,8 @@
4445
#define READ_BUF_SIZE 128U /* read buffer length in words */
4546
#define WRITE_BUF_SIZE 128U /* write buffer length in words */
4647

48+
#define AXIS_FIFO_DEBUG_REG_NAME_MAX_LEN 4
49+
4750
/* ----------------------------
4851
* IP register offsets
4952
* ----------------------------
@@ -137,180 +140,13 @@ struct axis_fifo {
137140

138141
struct device *dt_device; /* device created from the device tree */
139142
struct miscdevice miscdev;
140-
};
141-
142-
/* ----------------------------
143-
* sysfs entries
144-
* ----------------------------
145-
*/
146-
147-
static ssize_t sysfs_write(struct device *dev, const char *buf,
148-
size_t count, unsigned int addr_offset)
149-
{
150-
struct axis_fifo *fifo = dev_get_drvdata(dev);
151-
unsigned long tmp;
152-
int rc;
153-
154-
rc = kstrtoul(buf, 0, &tmp);
155-
if (rc < 0)
156-
return rc;
157-
158-
iowrite32(tmp, fifo->base_addr + addr_offset);
159-
160-
return count;
161-
}
162-
163-
static ssize_t sysfs_read(struct device *dev, char *buf,
164-
unsigned int addr_offset)
165-
{
166-
struct axis_fifo *fifo = dev_get_drvdata(dev);
167-
unsigned int read_val;
168-
169-
read_val = ioread32(fifo->base_addr + addr_offset);
170-
return sysfs_emit(buf, "0x%x\n", read_val);
171-
}
172-
173-
static ssize_t isr_store(struct device *dev, struct device_attribute *attr,
174-
const char *buf, size_t count)
175-
{
176-
return sysfs_write(dev, buf, count, XLLF_ISR_OFFSET);
177-
}
178-
179-
static ssize_t isr_show(struct device *dev,
180-
struct device_attribute *attr, char *buf)
181-
{
182-
return sysfs_read(dev, buf, XLLF_ISR_OFFSET);
183-
}
184-
185-
static DEVICE_ATTR_RW(isr);
186-
187-
static ssize_t ier_store(struct device *dev, struct device_attribute *attr,
188-
const char *buf, size_t count)
189-
{
190-
return sysfs_write(dev, buf, count, XLLF_IER_OFFSET);
191-
}
192-
193-
static ssize_t ier_show(struct device *dev,
194-
struct device_attribute *attr, char *buf)
195-
{
196-
return sysfs_read(dev, buf, XLLF_IER_OFFSET);
197-
}
198-
199-
static DEVICE_ATTR_RW(ier);
200-
201-
static ssize_t tdfr_store(struct device *dev, struct device_attribute *attr,
202-
const char *buf, size_t count)
203-
{
204-
return sysfs_write(dev, buf, count, XLLF_TDFR_OFFSET);
205-
}
206-
207-
static DEVICE_ATTR_WO(tdfr);
208-
209-
static ssize_t tdfv_show(struct device *dev,
210-
struct device_attribute *attr, char *buf)
211-
{
212-
return sysfs_read(dev, buf, XLLF_TDFV_OFFSET);
213-
}
214-
215-
static DEVICE_ATTR_RO(tdfv);
216-
217-
static ssize_t tdfd_store(struct device *dev, struct device_attribute *attr,
218-
const char *buf, size_t count)
219-
{
220-
return sysfs_write(dev, buf, count, XLLF_TDFD_OFFSET);
221-
}
222143

223-
static DEVICE_ATTR_WO(tdfd);
224-
225-
static ssize_t tlr_store(struct device *dev, struct device_attribute *attr,
226-
const char *buf, size_t count)
227-
{
228-
return sysfs_write(dev, buf, count, XLLF_TLR_OFFSET);
229-
}
230-
231-
static DEVICE_ATTR_WO(tlr);
232-
233-
static ssize_t rdfr_store(struct device *dev, struct device_attribute *attr,
234-
const char *buf, size_t count)
235-
{
236-
return sysfs_write(dev, buf, count, XLLF_RDFR_OFFSET);
237-
}
238-
239-
static DEVICE_ATTR_WO(rdfr);
240-
241-
static ssize_t rdfo_show(struct device *dev,
242-
struct device_attribute *attr, char *buf)
243-
{
244-
return sysfs_read(dev, buf, XLLF_RDFO_OFFSET);
245-
}
246-
247-
static DEVICE_ATTR_RO(rdfo);
248-
249-
static ssize_t rdfd_show(struct device *dev,
250-
struct device_attribute *attr, char *buf)
251-
{
252-
return sysfs_read(dev, buf, XLLF_RDFD_OFFSET);
253-
}
254-
255-
static DEVICE_ATTR_RO(rdfd);
256-
257-
static ssize_t rlr_show(struct device *dev,
258-
struct device_attribute *attr, char *buf)
259-
{
260-
return sysfs_read(dev, buf, XLLF_RLR_OFFSET);
261-
}
262-
263-
static DEVICE_ATTR_RO(rlr);
264-
265-
static ssize_t srr_store(struct device *dev, struct device_attribute *attr,
266-
const char *buf, size_t count)
267-
{
268-
return sysfs_write(dev, buf, count, XLLF_SRR_OFFSET);
269-
}
270-
271-
static DEVICE_ATTR_WO(srr);
272-
273-
static ssize_t tdr_store(struct device *dev, struct device_attribute *attr,
274-
const char *buf, size_t count)
275-
{
276-
return sysfs_write(dev, buf, count, XLLF_TDR_OFFSET);
277-
}
278-
279-
static DEVICE_ATTR_WO(tdr);
280-
281-
static ssize_t rdr_show(struct device *dev,
282-
struct device_attribute *attr, char *buf)
283-
{
284-
return sysfs_read(dev, buf, XLLF_RDR_OFFSET);
285-
}
286-
287-
static DEVICE_ATTR_RO(rdr);
288-
289-
static struct attribute *axis_fifo_attrs[] = {
290-
&dev_attr_isr.attr,
291-
&dev_attr_ier.attr,
292-
&dev_attr_tdfr.attr,
293-
&dev_attr_tdfv.attr,
294-
&dev_attr_tdfd.attr,
295-
&dev_attr_tlr.attr,
296-
&dev_attr_rdfr.attr,
297-
&dev_attr_rdfo.attr,
298-
&dev_attr_rdfd.attr,
299-
&dev_attr_rlr.attr,
300-
&dev_attr_srr.attr,
301-
&dev_attr_tdr.attr,
302-
&dev_attr_rdr.attr,
303-
NULL,
304-
};
305-
306-
static const struct attribute_group axis_fifo_attrs_group = {
307-
.name = "ip_registers",
308-
.attrs = axis_fifo_attrs,
144+
struct dentry *debugfs_dir;
309145
};
310146

311-
static const struct attribute_group *axis_fifo_attrs_groups[] = {
312-
&axis_fifo_attrs_group,
313-
NULL,
147+
struct axis_fifo_debug_reg {
148+
const char * const name;
149+
unsigned int offset;
314150
};
315151

316152
/* ----------------------------
@@ -711,6 +547,37 @@ static const struct file_operations fops = {
711547
.write = axis_fifo_write
712548
};
713549

550+
static int axis_fifo_debugfs_regs_show(struct seq_file *m, void *p)
551+
{
552+
static const struct axis_fifo_debug_reg regs[] = {
553+
{"isr", XLLF_ISR_OFFSET},
554+
{"ier", XLLF_IER_OFFSET},
555+
{"tdfv", XLLF_TDFV_OFFSET},
556+
{"rdfo", XLLF_RDFO_OFFSET},
557+
{ /* Sentinel */ },
558+
};
559+
const struct axis_fifo_debug_reg *reg;
560+
struct axis_fifo *fifo = m->private;
561+
562+
for (reg = regs; reg->name; ++reg) {
563+
u32 val = ioread32(fifo->base_addr + reg->offset);
564+
565+
seq_printf(m, "%*s: 0x%08x\n", AXIS_FIFO_DEBUG_REG_NAME_MAX_LEN,
566+
reg->name, val);
567+
}
568+
569+
return 0;
570+
}
571+
DEFINE_SHOW_ATTRIBUTE(axis_fifo_debugfs_regs);
572+
573+
static void axis_fifo_debugfs_init(struct axis_fifo *fifo)
574+
{
575+
fifo->debugfs_dir = debugfs_create_dir(dev_name(fifo->dt_device), NULL);
576+
577+
debugfs_create_file("regs", 0444, fifo->debugfs_dir, fifo,
578+
&axis_fifo_debugfs_regs_fops);
579+
}
580+
714581
/* read named property from the device tree */
715582
static int get_dts_property(struct axis_fifo *fifo,
716583
char *name, unsigned int *var)
@@ -877,12 +744,13 @@ static int axis_fifo_probe(struct platform_device *pdev)
877744
fifo->miscdev.fops = &fops;
878745
fifo->miscdev.minor = MISC_DYNAMIC_MINOR;
879746
fifo->miscdev.name = device_name;
880-
fifo->miscdev.groups = axis_fifo_attrs_groups;
881747
fifo->miscdev.parent = dev;
882748
rc = misc_register(&fifo->miscdev);
883749
if (rc < 0)
884750
goto err_initial;
885751

752+
axis_fifo_debugfs_init(fifo);
753+
886754
return 0;
887755

888756
err_initial:
@@ -895,6 +763,7 @@ static void axis_fifo_remove(struct platform_device *pdev)
895763
struct device *dev = &pdev->dev;
896764
struct axis_fifo *fifo = dev_get_drvdata(dev);
897765

766+
debugfs_remove(fifo->debugfs_dir);
898767
misc_deregister(&fifo->miscdev);
899768
dev_set_drvdata(dev, NULL);
900769
}

drivers/staging/fbtft/fbtft-core.c

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -568,18 +568,13 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
568568
height = display->height;
569569
}
570570

571-
vmem_size = display->width * display->height * bpp / 8;
572-
vmem = vzalloc(vmem_size);
573-
if (!vmem)
574-
goto alloc_fail;
575-
576571
fbdefio = devm_kzalloc(dev, sizeof(struct fb_deferred_io), GFP_KERNEL);
577572
if (!fbdefio)
578-
goto alloc_fail;
573+
return NULL;
579574

580575
buf = devm_kzalloc(dev, 128, GFP_KERNEL);
581576
if (!buf)
582-
goto alloc_fail;
577+
return NULL;
583578

584579
if (display->gamma_num && display->gamma_len) {
585580
gamma_curves = devm_kcalloc(dev,
@@ -588,12 +583,17 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
588583
sizeof(gamma_curves[0]),
589584
GFP_KERNEL);
590585
if (!gamma_curves)
591-
goto alloc_fail;
586+
return NULL;
592587
}
593588

594589
info = framebuffer_alloc(sizeof(struct fbtft_par), dev);
595590
if (!info)
596-
goto alloc_fail;
591+
return NULL;
592+
593+
vmem_size = display->width * display->height * bpp / 8;
594+
vmem = vzalloc(vmem_size);
595+
if (!vmem)
596+
goto release_framebuf;
597597

598598
info->screen_buffer = vmem;
599599
info->fbops = &fbtft_ops;
@@ -612,7 +612,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
612612
info->fix.line_length = width * bpp / 8;
613613
info->fix.accel = FB_ACCEL_NONE;
614614
info->fix.smem_len = vmem_size;
615-
fb_deferred_io_init(info);
615+
if (fb_deferred_io_init(info))
616+
goto release_screen_buffer;
616617

617618
info->var.rotate = pdata->rotate;
618619
info->var.xres = width;
@@ -652,7 +653,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
652653
if (par->gamma.curves && gamma) {
653654
if (fbtft_gamma_parse_str(par, par->gamma.curves, gamma,
654655
strlen(gamma)))
655-
goto release_framebuf;
656+
goto cleanup_deferred;
656657
}
657658

658659
/* Transmit buffer */
@@ -667,9 +668,9 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
667668
#endif
668669

669670
if (txbuflen > 0) {
670-
txbuf = devm_kzalloc(par->info->device, txbuflen, GFP_KERNEL);
671+
txbuf = kzalloc(txbuflen, GFP_KERNEL);
671672
if (!txbuf)
672-
goto release_framebuf;
673+
goto cleanup_deferred;
673674
par->txbuf.buf = txbuf;
674675
par->txbuf.len = txbuflen;
675676
}
@@ -691,12 +692,12 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
691692

692693
return info;
693694

695+
cleanup_deferred:
696+
fb_deferred_io_cleanup(info);
697+
release_screen_buffer:
698+
vfree(info->screen_buffer);
694699
release_framebuf:
695700
framebuffer_release(info);
696-
697-
alloc_fail:
698-
vfree(vmem);
699-
700701
return NULL;
701702
}
702703
EXPORT_SYMBOL(fbtft_framebuffer_alloc);
@@ -709,6 +710,9 @@ EXPORT_SYMBOL(fbtft_framebuffer_alloc);
709710
*/
710711
void fbtft_framebuffer_release(struct fb_info *info)
711712
{
713+
struct fbtft_par *par = info->par;
714+
715+
kfree(par->txbuf.buf);
712716
fb_deferred_io_cleanup(info);
713717
vfree(info->screen_buffer);
714718
framebuffer_release(info);

drivers/staging/gpib/TODO

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
TODO:
22
- checkpatch.pl fixes
3-
- fix device drivers that are broken ("depends on BROKEN" in Kconfig)
3+
These checks should be ignored:
4+
CHECK:ALLOC_SIZEOF_STRUCT: Prefer kmalloc(sizeof(*board->private_data)...) over kmalloc(sizeof(struct xxx_priv)...)
5+
./gpio/gpib_bitbang.c:50: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parenthese
6+
This warning will be addressed later: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string
47
- tidy-up comments:
58
- there are some "//comments" and "// comments" scattered around
69
- sometimes they are misaligned

0 commit comments

Comments
 (0)