From 2b9e12d0177c1543210a412e3f64a67ebb46ccb9 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Sun, 23 May 2010 22:01:56 +0200 Subject: [PATCH 1/5] arch/m68k/sun3/leds.c: Checkpatch cleanup arch/m68k/sun3/leds.c:10: ERROR: code indent should use tabs where possible arch/m68k/sun3/leds.c:11: ERROR: space required after that ',' (ctx:VxV) Signed-off-by: Andrea Gelmini Signed-off-by: Geert Uytterhoeven --- arch/m68k/sun3/leds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/m68k/sun3/leds.c b/arch/m68k/sun3/leds.c index a3e948463982..aad2e0a0682e 100644 --- a/arch/m68k/sun3/leds.c +++ b/arch/m68k/sun3/leds.c @@ -7,7 +7,7 @@ void sun3_leds(unsigned char byte) unsigned char dfc; GET_DFC(dfc); - SET_DFC(FC_CONTROL); - SET_CONTROL_BYTE(AC_LEDS,byte); + SET_DFC(FC_CONTROL); + SET_CONTROL_BYTE(AC_LEDS, byte); SET_DFC(dfc); } From 1b460102323a08874e942a330b896c30d50ab235 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Sat, 29 May 2010 03:27:18 +1000 Subject: [PATCH 2/5] m68k/mac: Add color classic ii support Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 1c16b1baf8db..c247de02bc7e 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -332,6 +332,15 @@ static struct mac_model mac_data_table[] = { .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, .floppy_type = MAC_FLOPPY_SWIM_ADDR2, + }, { + .ident = MAC_MODEL_CCLII, + .name = "Color Classic II", + .adb_type = MAC_ADB_CUDA, + .via_type = MAC_VIA_IIci, + .scsi_type = MAC_SCSI_OLD, + .scc_type = MAC_SCC_II, + .nubus_type = MAC_NUBUS, + .floppy_type = MAC_FLOPPY_SWIM_ADDR2, }, /* From d643e2d2cc1d1f37751a99a7c4cb30064cc68aac Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Wed, 2 Jun 2010 15:58:24 +0200 Subject: [PATCH 3/5] m68k/mac: Fix RTC on PMU machines Copy RTC response bytes correctly on powerbooks and duos. Thanks to Diego Cousinet who debugged this and provided me with the fix. Tested on PowerBook 190 and Duo 280c. Signed-off-by: Finn Thain Reported-by: Diego Cousinet Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 0f118ca156d9..e023fc6b37e5 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -91,7 +91,7 @@ static void cuda_write_pram(int offset, __u8 data) #define cuda_write_pram NULL #endif -#if 0 /* def CONFIG_ADB_PMU68K */ +#ifdef CONFIG_ADB_PMU68K static long pmu_read_time(void) { struct adb_request req; @@ -102,8 +102,8 @@ static long pmu_read_time(void) while (!req.complete) pmu_poll(); - time = (req.reply[0] << 24) | (req.reply[1] << 16) - | (req.reply[2] << 8) | req.reply[3]; + time = (req.reply[1] << 24) | (req.reply[2] << 16) + | (req.reply[3] << 8) | req.reply[4]; return time - RTC_OFFSET; } From d50ac468dd023db32c9455b2df56237caf601cbd Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sat, 5 Jun 2010 13:28:09 +0200 Subject: [PATCH 4/5] zorro: BKL removal Remove BKL use from proc_bus_zorro_lseek(), like was done for proc_bus_pci_lseek() a long time ago. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- drivers/zorro/proc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c index 3c7046d79654..4f4ea88fbb71 100644 --- a/drivers/zorro/proc.c +++ b/drivers/zorro/proc.c @@ -22,8 +22,9 @@ static loff_t proc_bus_zorro_lseek(struct file *file, loff_t off, int whence) { loff_t new = -1; + struct inode *inode = file->f_path.dentry->d_inode; - lock_kernel(); + mutex_lock(&inode->i_mutex); switch (whence) { case 0: new = off; @@ -35,12 +36,12 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence) new = sizeof(struct ConfigDev) + off; break; } - if (new < 0 || new > sizeof(struct ConfigDev)) { - unlock_kernel(); - return -EINVAL; - } - unlock_kernel(); - return (file->f_pos = new); + if (new < 0 || new > sizeof(struct ConfigDev)) + new = -EINVAL; + else + file->f_pos = new; + mutex_unlock(&inode->i_mutex); + return new; } static ssize_t From 2190a1e7705456c2298873b2547a6eb19b8e31ae Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 9 Jun 2010 11:24:32 +0200 Subject: [PATCH 5/5] zorro: Fix reading of proc/bus/zorro/* in small chunks proc_bus_zorro_read() didn't take into account the current file position, hence it always read from the start of the ConfigDev. Signed-off-by: Geert Uytterhoeven --- drivers/zorro/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c index 4f4ea88fbb71..cafc50454292 100644 --- a/drivers/zorro/proc.c +++ b/drivers/zorro/proc.c @@ -68,7 +68,7 @@ proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t * cd.cd_BoardAddr = (void *)zorro_resource_start(z); cd.cd_BoardSize = zorro_resource_len(z); - if (copy_to_user(buf, &cd, nbytes)) + if (copy_to_user(buf, (void *)&cd + pos, nbytes)) return -EFAULT; *ppos += nbytes;