Commit 5cd4dc44 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull staging driver updates from Greg KH:
 "Here is the big set of staging driver updates and cleanups for
  5.16-rc1.

  Overall we ended up removing a lot of code this time, a bit over
  20,000 lines are now gone thanks to a lot of cleanup work by many
  developers.

  Nothing huge in here functionality wise, just loads of cleanups:

   - r8188eu driver major cleanups and removal of unused and dead code

   - wlan-ng minor cleanups

   - fbtft driver cleanups

   - most driver cleanups

   - rtl8* drivers cleanups

   - rts5208 driver cleanups

   - vt6655 driver cleanups

   - vc04_services drivers cleanups

   - wfx cleanups on the way to almost getting this merged out of
     staging (it's close!)

   - tiny mips changes needed for the mt7621 drivers, they have been
     acked by the respective subsystem maintainers to go through this
     tree.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'staging-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (622 commits)
  staging: r8188eu: hal: remove goto statement and local variable
  staging: rtl8723bs: hal remove the assignment to itself
  staging: rtl8723bs: fix unmet dependency on CRYPTO for CRYPTO_LIB_ARC4
  staging: vchiq_core: get rid of typedef
  staging: fieldbus: anybus: reframe comment to avoid warning
  staging: r8188eu: fix missing unlock in rtw_resume()
  staging: r8188eu: core: remove the goto from rtw_IOL_accquire_xmit_frame
  staging: r8188eu: core: remove goto statement
  staging: vt6655: Rename `dwAL7230InitTable` array
  staging: vt6655: Rename `dwAL2230PowerTable` array
  staging: vt6655: Rename `dwAL7230InitTableAMode` array
  staging: vt6655: Rename `dwAL7230ChannelTable2` array
  staging: vt6655: Rename `dwAL7230ChannelTable1` array
  staging: vt6655: Rename `dwAL7230ChannelTable0` array
  staging: vt6655: Rename `dwAL2230ChannelTable1` array
  staging: vt6655: Rename `dwAL2230ChannelTable0` array
  staging: r8712u: fix control-message timeout
  staging: rtl8192u: fix control-message timeouts
  staging: mt7621-dts: add missing SPDX license to files
  staging: vchiq_core: fix quoted strings split across lines
  ...
parents 048ff862 10508ae0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@
#ifndef __ASM_MACH_RALINK_SPACES_H_
#define __ASM_MACH_RALINK_SPACES_H_

#define PCI_IOBASE	_AC(0xa0000000, UL)
#define PCI_IOSIZE	SZ_16M
#define PCI_IOBASE	mips_io_port_base
#define PCI_IOSIZE	SZ_64K
#define IO_SPACE_LIMIT	(PCI_IOSIZE - 1)

#include <asm/mach-generic/spaces.h>
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,10 @@
#include <linux/list.h>
#include <linux/of.h>

#ifdef CONFIG_PCI_DRIVERS_GENERIC
#define pci_remap_iospace pci_remap_iospace
#endif

#ifdef CONFIG_PCI_DRIVERS_LEGACY

/*
+14 −0
Original line number Diff line number Diff line
@@ -46,3 +46,17 @@ void pcibios_fixup_bus(struct pci_bus *bus)
{
	pci_read_bridge_bases(bus);
}

int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
{
	unsigned long vaddr;

	if (res->start != 0) {
		WARN_ONCE(1, "resource start address is not zero\n");
		return -ENODEV;
	}

	vaddr = (unsigned long)ioremap(phys_addr, resource_size(res));
	set_io_port_base(vaddr);
	return 0;
}
+2 −0
Original line number Diff line number Diff line
@@ -4101,6 +4101,7 @@ unsigned long __weak pci_address_to_pio(phys_addr_t address)
 * architectures that have memory mapped IO functions defined (and the
 * PCI_IOBASE value defined) should call this function.
 */
#ifndef pci_remap_iospace
int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
{
#if defined(PCI_IOBASE) && defined(CONFIG_MMU)
@@ -4124,6 +4125,7 @@ int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
#endif
}
EXPORT_SYMBOL(pci_remap_iospace);
#endif

/**
 * pci_unmap_iospace - Unmap the memory mapped I/O space
+26 −62
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/jiffies.h>
#include <linux/miscdevice.h>

#include <linux/of_address.h>
#include <linux/of_device.h>
@@ -102,9 +103,6 @@
 *           globals
 * ----------------------------
 */

static struct class *axis_fifo_driver_class; /* char device class */

static int read_timeout = 1000; /* ms to wait before read() times out */
static int write_timeout = 1000; /* ms to wait before write() times out */

@@ -140,9 +138,7 @@ struct axis_fifo {
	unsigned int read_flags; /* read file flags */

	struct device *dt_device; /* device created from the device tree */
	struct device *device; /* device associated with char_device */
	dev_t devt; /* our char device number */
	struct cdev char_device; /* our char device */
	struct miscdevice miscdev;
};

/* ----------------------------
@@ -319,6 +315,11 @@ static const struct attribute_group axis_fifo_attrs_group = {
	.attrs = axis_fifo_attrs,
};

static const struct attribute_group *axis_fifo_attrs_groups[] = {
	&axis_fifo_attrs_group,
	NULL,
};

/* ----------------------------
 *        implementation
 * ----------------------------
@@ -684,8 +685,8 @@ static irqreturn_t axis_fifo_irq(int irq, void *dw)

static int axis_fifo_open(struct inode *inod, struct file *f)
{
	struct axis_fifo *fifo = (struct axis_fifo *)container_of(inod->i_cdev,
					struct axis_fifo, char_device);
	struct axis_fifo *fifo = container_of(f->private_data,
					      struct axis_fifo, miscdev);
	f->private_data = fifo;

	if (((f->f_flags & O_ACCMODE) == O_WRONLY) ||
@@ -812,9 +813,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
	struct resource *r_mem; /* IO mem resources */
	struct device *dev = &pdev->dev; /* OS device (from device tree) */
	struct axis_fifo *fifo = NULL;

	char device_name[32];

	char *device_name;
	int rc = 0; /* error return value */

	/* ----------------------------
@@ -822,8 +821,12 @@ static int axis_fifo_probe(struct platform_device *pdev)
	 * ----------------------------
	 */

	device_name = devm_kzalloc(dev, 32, GFP_KERNEL);
	if (!device_name)
		return -ENOMEM;

	/* allocate device wrapper memory */
	fifo = devm_kmalloc(dev, sizeof(*fifo), GFP_KERNEL);
	fifo = devm_kzalloc(dev, sizeof(*fifo), GFP_KERNEL);
	if (!fifo)
		return -ENOMEM;

@@ -859,9 +862,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
	dev_dbg(fifo->dt_device, "remapped memory to 0x%p\n", fifo->base_addr);

	/* create unique device name */
	snprintf(device_name, sizeof(device_name), "%s_%pa",
		 DRIVER_NAME, &r_mem->start);

	snprintf(device_name, 32, "%s_%pa", DRIVER_NAME, &r_mem->start);
	dev_dbg(fifo->dt_device, "device name [%s]\n", device_name);

	/* ----------------------------
@@ -904,51 +905,21 @@ static int axis_fifo_probe(struct platform_device *pdev)
	 * ----------------------------
	 */

	/* allocate device number */
	rc = alloc_chrdev_region(&fifo->devt, 0, 1, DRIVER_NAME);
	/* create character device */
	fifo->miscdev.fops = &fops;
	fifo->miscdev.minor = MISC_DYNAMIC_MINOR;
	fifo->miscdev.name = device_name;
	fifo->miscdev.groups = axis_fifo_attrs_groups;
	fifo->miscdev.parent = dev;
	rc = misc_register(&fifo->miscdev);
	if (rc < 0)
		goto err_initial;
	dev_dbg(fifo->dt_device, "allocated device number major %i minor %i\n",
		MAJOR(fifo->devt), MINOR(fifo->devt));

	/* create driver file */
	fifo->device = device_create(axis_fifo_driver_class, NULL, fifo->devt,
				     NULL, device_name);
	if (IS_ERR(fifo->device)) {
		dev_err(fifo->dt_device,
			"couldn't create driver file\n");
		rc = PTR_ERR(fifo->device);
		goto err_chrdev_region;
	}
	dev_set_drvdata(fifo->device, fifo);

	/* create character device */
	cdev_init(&fifo->char_device, &fops);
	rc = cdev_add(&fifo->char_device, fifo->devt, 1);
	if (rc < 0) {
		dev_err(fifo->dt_device, "couldn't create character device\n");
		goto err_dev;
	}

	/* create sysfs entries */
	rc = devm_device_add_group(fifo->device, &axis_fifo_attrs_group);
	if (rc < 0) {
		dev_err(fifo->dt_device, "couldn't register sysfs group\n");
		goto err_cdev;
	}

	dev_info(fifo->dt_device, "axis-fifo created at %pa mapped to 0x%pa, irq=%i, major=%i, minor=%i\n",
		 &r_mem->start, &fifo->base_addr, fifo->irq,
		 MAJOR(fifo->devt), MINOR(fifo->devt));
	dev_info(fifo->dt_device, "axis-fifo created at %pa mapped to 0x%pa, irq=%i\n",
		 &r_mem->start, &fifo->base_addr, fifo->irq);

	return 0;

err_cdev:
	cdev_del(&fifo->char_device);
err_dev:
	device_destroy(axis_fifo_driver_class, fifo->devt);
err_chrdev_region:
	unregister_chrdev_region(fifo->devt, 1);
err_initial:
	dev_set_drvdata(dev, NULL);
	return rc;
@@ -959,10 +930,7 @@ static int axis_fifo_remove(struct platform_device *pdev)
	struct device *dev = &pdev->dev;
	struct axis_fifo *fifo = dev_get_drvdata(dev);

	cdev_del(&fifo->char_device);
	dev_set_drvdata(fifo->device, NULL);
	device_destroy(axis_fifo_driver_class, fifo->devt);
	unregister_chrdev_region(fifo->devt, 1);
	misc_deregister(&fifo->miscdev);
	dev_set_drvdata(dev, NULL);

	return 0;
@@ -987,9 +955,6 @@ static int __init axis_fifo_init(void)
{
	pr_info("axis-fifo driver loaded with parameters read_timeout = %i, write_timeout = %i\n",
		read_timeout, write_timeout);
	axis_fifo_driver_class = class_create(THIS_MODULE, DRIVER_NAME);
	if (IS_ERR(axis_fifo_driver_class))
		return PTR_ERR(axis_fifo_driver_class);
	return platform_driver_register(&axis_fifo_driver);
}

@@ -998,7 +963,6 @@ module_init(axis_fifo_init);
static void __exit axis_fifo_exit(void)
{
	platform_driver_unregister(&axis_fifo_driver);
	class_destroy(axis_fifo_driver_class);
}

module_exit(axis_fifo_exit);
Loading