Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next
Browse files Browse the repository at this point in the history
Pull sparc updates from David Miller:

 - Automatic system call table generation, from Firoz Khan.

 - Clean up accesses to the OF device names by using full_name instead
   of path_component_name.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next:
  ALSA: sparc: Use of_node_name_eq for node name comparisons
  sbus: Use of_node_name_eq for node name comparisons
  sparc: generate uapi header and system call table files
  sparc: add system call table generation support
  sparc: add __NR_syscalls along with NR_syscalls
  sparc: move __IGNORE* entries to non uapi header
  sparc: Use DT node full_name instead of name for resources
  sparc: Remove unused leon_trans_init
  sparc: Use device_type helpers to access the node type
  sparc: Use of_node_name_eq for node name comparisons
  sparc: Convert to using %pOFn instead of device_node.name
  sparc: prom: use property "name" directly to construct node names
  of: Drop full path from full_name for PDT systems
  sparc: Convert to using %pOF instead of full_name
  fs/openpromfs: Use of_node_name_eq for node name comparisons
  fs/openpromfs: use full_name instead of path_component_name
  • Loading branch information
torvalds committed Dec 26, 2018
2 parents 9830afc + c23b8e7 commit c2f1f3e
Show file tree
Hide file tree
Showing 42 changed files with 777 additions and 904 deletions.
3 changes: 3 additions & 0 deletions arch/sparc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ install:
archclean:
$(Q)$(MAKE) $(clean)=$(boot)

archheaders:
$(Q)$(MAKE) $(build)=arch/sparc/kernel/syscalls all

PHONY += vdso_install
vdso_install:
$(Q)$(MAKE) $(build)=arch/sparc/vdso $@
Expand Down
4 changes: 3 additions & 1 deletion arch/sparc/include/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# User exported sparc header files


generated-y += syscall_table_32.h
generated-y += syscall_table_64.h
generated-y += syscall_table_c32.h
generic-y += div64.h
generic-y += emergency-restart.h
generic-y += exec.h
Expand Down
8 changes: 4 additions & 4 deletions arch/sparc/include/asm/floppy_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ static int sun_pci_fd_test_drive(unsigned long port, int drive)

static int __init ebus_fdthree_p(struct device_node *dp)
{
if (!strcmp(dp->name, "fdthree"))
if (of_node_name_eq(dp, "fdthree"))
return 1;
if (!strcmp(dp->name, "floppy")) {
if (of_node_name_eq(dp, "floppy")) {
const char *compat;

compat = of_get_property(dp, "compatible", NULL);
Expand All @@ -555,7 +555,7 @@ static unsigned long __init sun_floppy_init(void)
op = NULL;

for_each_node_by_name(dp, "SUNW,fdtwo") {
if (strcmp(dp->parent->name, "sbus"))
if (!of_node_name_eq(dp->parent, "sbus"))
continue;
op = of_find_device_by_node(dp);
if (op)
Expand Down Expand Up @@ -656,7 +656,7 @@ static unsigned long __init sun_floppy_init(void)
*/
config = 0;
for (dp = ebus_dp->child; dp; dp = dp->sibling) {
if (!strcmp(dp->name, "ecpp")) {
if (of_node_name_eq(dp, "ecpp")) {
struct platform_device *ecpp_op;

ecpp_op = of_find_device_by_node(dp);
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/include/asm/leon.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ void leon_update_virq_handling(unsigned int virq,
irq_flow_handler_t flow_handler,
const char *name, int do_ack);
void leon_init_timers(void);
void leon_trans_init(struct device_node *dp);
void leon_node_init(struct device_node *dp, struct device_node ***nextp);
void init_leon(void);
void poke_leonsparc(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/parport.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static int ecpp_probe(struct platform_device *op)
int slot, err;

parent = op->dev.of_node->parent;
if (!strcmp(parent->name, "dma")) {
if (of_node_name_eq(parent, "dma")) {
p = parport_pc_probe_port(base, base + 0x400,
op->archdata.irqs[0], PARPORT_DMA_NOFIFO,
op->dev.parent->parent, 0);
Expand Down
18 changes: 18 additions & 0 deletions arch/sparc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include <uapi/asm/unistd.h>

#define NR_syscalls __NR_syscalls

#ifdef __32bit_syscall_numbers__
#else
#define __NR_time 231 /* Linux sparc32 */
Expand Down Expand Up @@ -46,4 +48,20 @@
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
#endif

#ifdef __32bit_syscall_numbers__
/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
* it never had the plain ones and there is no value to adding those
* old versions into the syscall table.
*/
#define __IGNORE_setresuid
#define __IGNORE_getresuid
#define __IGNORE_setresgid
#define __IGNORE_getresgid
#endif

/* Sparc doesn't have protection keys. */
#define __IGNORE_pkey_mprotect
#define __IGNORE_pkey_alloc
#define __IGNORE_pkey_free

#endif /* _SPARC_UNISTD_H */
2 changes: 2 additions & 0 deletions arch/sparc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
generic-y += bpf_perf_event.h
generic-y += types.h
426 changes: 3 additions & 423 deletions arch/sparc/include/uapi/asm/unistd.h

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions arch/sparc/kernel/auxio_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,22 @@ static int auxio_probe(struct platform_device *dev)
struct device_node *dp = dev->dev.of_node;
unsigned long size;

if (!strcmp(dp->parent->name, "ebus")) {
if (of_node_name_eq(dp->parent, "ebus")) {
auxio_devtype = AUXIO_TYPE_EBUS;
size = sizeof(u32);
} else if (!strcmp(dp->parent->name, "sbus")) {
} else if (of_node_name_eq(dp->parent, "sbus")) {
auxio_devtype = AUXIO_TYPE_SBUS;
size = 1;
} else {
printk("auxio: Unknown parent bus type [%s]\n",
dp->parent->name);
printk("auxio: Unknown parent bus type [%pOFn]\n",
dp->parent);
return -ENODEV;
}
auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
if (!auxio_register)
return -ENODEV;

printk(KERN_INFO "AUXIO: Found device at %s\n",
dp->full_name);
printk(KERN_INFO "AUXIO: Found device at %pOF\n", dp);

if (auxio_devtype == AUXIO_TYPE_EBUS)
auxio_set_led(AUXIO_LED_ON);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static int fhc_probe(struct platform_device *op)
goto out;
}

if (!strcmp(op->dev.of_node->parent->name, "central"))
if (of_node_name_eq(op->dev.of_node->parent, "central"))
p->central = true;

p->pregs = of_ioremap(&op->resource[0], 0,
Expand Down
8 changes: 4 additions & 4 deletions arch/sparc/kernel/chmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ static int jbusmc_probe(struct platform_device *op)

mc_list_add(&p->list);

printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n",
op->dev.of_node->full_name);
printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %pOF\n",
op->dev.of_node);

dev_set_drvdata(&op->dev, p);

Expand Down Expand Up @@ -747,8 +747,8 @@ static int chmc_probe(struct platform_device *op)

mc_list_add(&p->list);

printk(KERN_INFO PFX "UltraSPARC-III memory controller at %s [%s]\n",
dp->full_name,
printk(KERN_INFO PFX "UltraSPARC-III memory controller at %pOF [%s]\n",
dp,
(p->layout_size ? "ACTIVE" : "INACTIVE"));

dev_set_drvdata(&op->dev, p);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/ioport.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len,
if (sbus_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0)
goto err_noiommu;

res->name = op->dev.of_node->name;
res->name = op->dev.of_node->full_name;

return (void *)(unsigned long)res->start;

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ static void map_prom_timers(void)
dp = of_find_node_by_path("/");
dp = dp->child;
while (dp) {
if (!strcmp(dp->name, "counter-timer"))
if (of_node_name_eq(dp, "counter-timer"))
break;
dp = dp->sibling;
}
Expand Down
14 changes: 0 additions & 14 deletions arch/sparc/kernel/leon_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,20 +484,6 @@ static void leon_load_profile_irq(int cpu, unsigned int limit)
{
}

void __init leon_trans_init(struct device_node *dp)
{
if (strcmp(dp->type, "cpu") == 0 && strcmp(dp->name, "<NULL>") == 0) {
struct property *p;
p = of_find_property(dp, "mid", (void *)0);
if (p) {
int mid;
dp->name = prom_early_alloc(5 + 1);
memcpy(&mid, p->value, p->length);
sprintf((char *)dp->name, "cpu%.2d", mid);
}
}
}

#ifdef CONFIG_SMP
void leon_clear_profile_irq(int cpu)
{
Expand Down
21 changes: 10 additions & 11 deletions arch/sparc/kernel/of_device_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

static int of_bus_pci_match(struct device_node *np)
{
if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) {
if (of_node_is_type(np, "pci") || of_node_is_type(np, "pciex")) {
/* Do not do PCI specific frobbing if the
* PCI bridge lacks a ranges property. We
* want to pass it through up to the next
Expand Down Expand Up @@ -107,7 +107,7 @@ static unsigned long of_bus_sbus_get_flags(const u32 *addr, unsigned long flags)

static int of_bus_ambapp_match(struct device_node *np)
{
return !strcmp(np->type, "ambapp");
return of_node_is_type(np, "ambapp");
}

static void of_bus_ambapp_count_cells(struct device_node *child,
Expand Down Expand Up @@ -232,10 +232,10 @@ static int __init use_1to1_mapping(struct device_node *pp)
* But, we should still pass the translation work up
* to the SBUS itself.
*/
if (!strcmp(pp->name, "dma") ||
!strcmp(pp->name, "espdma") ||
!strcmp(pp->name, "ledma") ||
!strcmp(pp->name, "lebuffer"))
if (of_node_name_eq(pp, "dma") ||
of_node_name_eq(pp, "espdma") ||
of_node_name_eq(pp, "ledma") ||
of_node_name_eq(pp, "lebuffer"))
return 0;

return 1;
Expand Down Expand Up @@ -324,16 +324,16 @@ static void __init build_device_resources(struct platform_device *op,
memset(r, 0, sizeof(*r));

if (of_resource_verbose)
printk("%s reg[%d] -> %llx\n",
op->dev.of_node->full_name, index,
printk("%pOF reg[%d] -> %llx\n",
op->dev.of_node, index,
result);

if (result != OF_BAD_ADDR) {
r->start = result & 0xffffffff;
r->end = result + size - 1;
r->flags = flags | ((result >> 32ULL) & 0xffUL);
}
r->name = op->dev.of_node->name;
r->name = op->dev.of_node->full_name;
}
}

Expand Down Expand Up @@ -386,8 +386,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
op->dev.dma_mask = &op->dev.coherent_dma_mask;

if (of_device_register(op)) {
printk("%s: Could not register of device.\n",
dp->full_name);
printk("%pOF: Could not register of device.\n", dp);
kfree(op);
op = NULL;
}
Expand Down
Loading

0 comments on commit c2f1f3e

Please sign in to comment.