aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:50:35 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:50:35 -0400
commit88c8199b9d2f5ec0a8468a0495ba4c9656846500 (patch)
tree666dc82c5a1ec041a7312f4ef3306bb1806620eb
parent0439208a8a399f0c4307c561d97e3f5523f5d085 (diff)
parent50aa485e1abb7566ce68418c7bbc6a6b454f9039 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [BBC_I2C]: kmalloc + memset conversion to kzalloc [BBC_ENVCTRL]: kmalloc + memset conversion to kzalloc [SPARC]: Fix exec failures on sun4c. [SPARC] Videopix Frame Grabber: Fix unreleased lock in vfc_debug() [SPARC64]: Add missing dma_get_cache_alignment(). [SUNLANCE]: Fix sparc32 crashes by using of_*() interfaces.
-rw-r--r--arch/sparc/mm/sun4c.c3
-rw-r--r--drivers/net/sunlance.c48
-rw-r--r--drivers/sbus/char/bbc_envctrl.c10
-rw-r--r--drivers/sbus/char/bbc_i2c.c4
-rw-r--r--include/asm-sparc64/dma-mapping.h7
5 files changed, 38 insertions, 34 deletions
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index a57a366e339a..79d60d86f6f8 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -1999,6 +1999,9 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p
1999 unsigned long flags; 1999 unsigned long flags;
2000 int pseg; 2000 int pseg;
2001 2001
2002 if (vma->vm_mm->context == NO_CONTEXT)
2003 return;
2004
2002 local_irq_save(flags); 2005 local_irq_save(flags);
2003 address &= PAGE_MASK; 2006 address &= PAGE_MASK;
2004 if ((pseg = sun4c_get_segmap(address)) == invalid_segment) { 2007 if ((pseg = sun4c_get_segmap(address)) == invalid_segment) {
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 053b7cb0d944..68e4f660367d 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -99,8 +99,7 @@ static char lancestr[] = "LANCE";
99#include <asm/byteorder.h> /* Used by the checksum routines */ 99#include <asm/byteorder.h> /* Used by the checksum routines */
100#include <asm/idprom.h> 100#include <asm/idprom.h>
101#include <asm/sbus.h> 101#include <asm/sbus.h>
102#include <asm/openprom.h> 102#include <asm/prom.h>
103#include <asm/oplib.h>
104#include <asm/auxio.h> /* For tpe-link-test? setting */ 103#include <asm/auxio.h> /* For tpe-link-test? setting */
105#include <asm/irq.h> 104#include <asm/irq.h>
106 105
@@ -1326,6 +1325,7 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev,
1326 struct sbus_dev *lebuffer) 1325 struct sbus_dev *lebuffer)
1327{ 1326{
1328 static unsigned version_printed; 1327 static unsigned version_printed;
1328 struct device_node *dp = sdev->ofdev.node;
1329 struct net_device *dev; 1329 struct net_device *dev;
1330 struct lance_private *lp; 1330 struct lance_private *lp;
1331 int i; 1331 int i;
@@ -1389,54 +1389,46 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev,
1389 lp->rx = lance_rx_dvma; 1389 lp->rx = lance_rx_dvma;
1390 lp->tx = lance_tx_dvma; 1390 lp->tx = lance_tx_dvma;
1391 } 1391 }
1392 lp->busmaster_regval = prom_getintdefault(sdev->prom_node, 1392 lp->busmaster_regval = of_getintprop_default(dp, "busmaster-regval",
1393 "busmaster-regval", 1393 (LE_C3_BSWP |
1394 (LE_C3_BSWP | LE_C3_ACON | 1394 LE_C3_ACON |
1395 LE_C3_BCON)); 1395 LE_C3_BCON));
1396 1396
1397 lp->name = lancestr; 1397 lp->name = lancestr;
1398 lp->ledma = ledma; 1398 lp->ledma = ledma;
1399 1399
1400 lp->burst_sizes = 0; 1400 lp->burst_sizes = 0;
1401 if (lp->ledma) { 1401 if (lp->ledma) {
1402 char prop[6]; 1402 struct device_node *ledma_dp = ledma->sdev->ofdev.node;
1403 const char *prop;
1403 unsigned int sbmask; 1404 unsigned int sbmask;
1404 u32 csr; 1405 u32 csr;
1405 1406
1406 /* Find burst-size property for ledma */ 1407 /* Find burst-size property for ledma */
1407 lp->burst_sizes = prom_getintdefault(ledma->sdev->prom_node, 1408 lp->burst_sizes = of_getintprop_default(ledma_dp,
1408 "burst-sizes", 0); 1409 "burst-sizes", 0);
1409 1410
1410 /* ledma may be capable of fast bursts, but sbus may not. */ 1411 /* ledma may be capable of fast bursts, but sbus may not. */
1411 sbmask = prom_getintdefault(ledma->sdev->bus->prom_node, 1412 sbmask = of_getintprop_default(ledma_dp, "burst-sizes",
1412 "burst-sizes", DMA_BURSTBITS); 1413 DMA_BURSTBITS);
1413 lp->burst_sizes &= sbmask; 1414 lp->burst_sizes &= sbmask;
1414 1415
1415 /* Get the cable-selection property */ 1416 /* Get the cable-selection property */
1416 memset(prop, 0, sizeof(prop)); 1417 prop = of_get_property(ledma_dp, "cable-selection", NULL);
1417 prom_getstring(ledma->sdev->prom_node, "cable-selection", 1418 if (!prop || prop[0] == '\0') {
1418 prop, sizeof(prop)); 1419 struct device_node *nd;
1419 if (prop[0] == 0) {
1420 int topnd, nd;
1421 1420
1422 printk(KERN_INFO "SunLance: using auto-carrier-detection.\n"); 1421 printk(KERN_INFO "SunLance: using "
1422 "auto-carrier-detection.\n");
1423 1423
1424 /* Is this found at /options .attributes in all 1424 nd = of_find_node_by_path("/options");
1425 * Prom versions? XXX
1426 */
1427 topnd = prom_getchild(prom_root_node);
1428
1429 nd = prom_searchsiblings(topnd, "options");
1430 if (!nd) 1425 if (!nd)
1431 goto no_link_test; 1426 goto no_link_test;
1432 1427
1433 if (!prom_node_has_property(nd, "tpe-link-test?")) 1428 prop = of_get_property(nd, "tpe-link-test?", NULL);
1429 if (!prop)
1434 goto no_link_test; 1430 goto no_link_test;
1435 1431
1436 memset(prop, 0, sizeof(prop));
1437 prom_getstring(nd, "tpe-link-test?", prop,
1438 sizeof(prop));
1439
1440 if (strcmp(prop, "true")) { 1432 if (strcmp(prop, "true")) {
1441 printk(KERN_NOTICE "SunLance: warning: overriding option " 1433 printk(KERN_NOTICE "SunLance: warning: overriding option "
1442 "'tpe-link-test?'\n"); 1434 "'tpe-link-test?'\n");
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c
index e821a155b658..0bde26989a23 100644
--- a/drivers/sbus/char/bbc_envctrl.c
+++ b/drivers/sbus/char/bbc_envctrl.c
@@ -479,11 +479,12 @@ static int kenvctrld(void *__unused)
479 479
480static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx) 480static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
481{ 481{
482 struct bbc_cpu_temperature *tp = kmalloc(sizeof(*tp), GFP_KERNEL); 482 struct bbc_cpu_temperature *tp;
483 483
484 tp = kzalloc(sizeof(*tp), GFP_KERNEL);
484 if (!tp) 485 if (!tp)
485 return; 486 return;
486 memset(tp, 0, sizeof(*tp)); 487
487 tp->client = bbc_i2c_attach(echild); 488 tp->client = bbc_i2c_attach(echild);
488 if (!tp->client) { 489 if (!tp->client) {
489 kfree(tp); 490 kfree(tp);
@@ -525,11 +526,12 @@ static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
525 526
526static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx) 527static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx)
527{ 528{
528 struct bbc_fan_control *fp = kmalloc(sizeof(*fp), GFP_KERNEL); 529 struct bbc_fan_control *fp;
529 530
531 fp = kzalloc(sizeof(*fp), GFP_KERNEL);
530 if (!fp) 532 if (!fp)
531 return; 533 return;
532 memset(fp, 0, sizeof(*fp)); 534
533 fp->client = bbc_i2c_attach(echild); 535 fp->client = bbc_i2c_attach(echild);
534 if (!fp->client) { 536 if (!fp->client) {
535 kfree(fp); 537 kfree(fp);
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
index fbadd4d761f3..ac8ef2ce07fb 100644
--- a/drivers/sbus/char/bbc_i2c.c
+++ b/drivers/sbus/char/bbc_i2c.c
@@ -357,13 +357,13 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
357 357
358static int __init attach_one_i2c(struct linux_ebus_device *edev, int index) 358static int __init attach_one_i2c(struct linux_ebus_device *edev, int index)
359{ 359{
360 struct bbc_i2c_bus *bp = kmalloc(sizeof(*bp), GFP_KERNEL); 360 struct bbc_i2c_bus *bp;
361 struct linux_ebus_child *echild; 361 struct linux_ebus_child *echild;
362 int entry; 362 int entry;
363 363
364 bp = kzalloc(sizeof(*bp), GFP_KERNEL);
364 if (!bp) 365 if (!bp)
365 return -ENOMEM; 366 return -ENOMEM;
366 memset(bp, 0, sizeof(*bp));
367 367
368 bp->i2c_control_regs = ioremap(edev->resource[0].start, 0x2); 368 bp->i2c_control_regs = ioremap(edev->resource[0].start, 0x2);
369 if (!bp->i2c_control_regs) 369 if (!bp->i2c_control_regs)
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index 0a1006692bb2..a72a5f271f31 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -127,6 +127,13 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
127 return (dma_addr == DMA_ERROR_CODE); 127 return (dma_addr == DMA_ERROR_CODE);
128} 128}
129 129
130static inline int dma_get_cache_alignment(void)
131{
132 /* no easy way to get cache size on all processors, so return
133 * the maximum possible, to be safe */
134 return (1 << INTERNODE_CACHE_SHIFT);
135}
136
130#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 137#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
131#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 138#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
132#define dma_is_consistent(d, h) (1) 139#define dma_is_consistent(d, h) (1)