提交 53a49982 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] sysfs_create_xxx return values.
  [S390] .align 4096 statements in head.S
  [S390] get_clock inline assembly.
  [S390] channel measurement interval display.
  [S390] xpram module parameter parsing - take 2.
  [S390] Fix gcc warning about unused return values.
...@@ -273,7 +273,7 @@ startup_continue: ...@@ -273,7 +273,7 @@ startup_continue:
.Lbss_end: .long _end .Lbss_end: .long _end
.Lparmaddr: .long PARMAREA .Lparmaddr: .long PARMAREA
.Lsccbaddr: .long .Lsccb .Lsccbaddr: .long .Lsccb
.align 4096 .org 0x12000
.Lsccb: .Lsccb:
.hword 0x1000 # length, one page .hword 0x1000 # length, one page
.byte 0x00,0x00,0x00 .byte 0x00,0x00,0x00
...@@ -290,7 +290,7 @@ startup_continue: ...@@ -290,7 +290,7 @@ startup_continue:
.Lscpincr2: .Lscpincr2:
.quad 0x00 .quad 0x00
.fill 3984,1,0 .fill 3984,1,0
.align 4096 .org 0x13000
#ifdef CONFIG_SHARED_KERNEL #ifdef CONFIG_SHARED_KERNEL
.org 0x100000 .org 0x100000
......
...@@ -268,7 +268,7 @@ startup_continue: ...@@ -268,7 +268,7 @@ startup_continue:
.Lparmaddr: .Lparmaddr:
.quad PARMAREA .quad PARMAREA
.align 4096 .org 0x12000
.Lsccb: .Lsccb:
.hword 0x1000 # length, one page .hword 0x1000 # length, one page
.byte 0x00,0x00,0x00 .byte 0x00,0x00,0x00
...@@ -285,7 +285,7 @@ startup_continue: ...@@ -285,7 +285,7 @@ startup_continue:
.Lscpincr2: .Lscpincr2:
.quad 0x00 .quad 0x00
.fill 3984,1,0 .fill 3984,1,0
.align 4096 .org 0x13000
#ifdef CONFIG_SHARED_KERNEL #ifdef CONFIG_SHARED_KERNEL
.org 0x100000 .org 0x100000
......
...@@ -877,31 +877,57 @@ static struct bin_attribute ipl_scp_data_attr = { ...@@ -877,31 +877,57 @@ static struct bin_attribute ipl_scp_data_attr = {
static decl_subsys(ipl, NULL, NULL); static decl_subsys(ipl, NULL, NULL);
static int ipl_register_fcp_files(void)
{
int rc;
rc = sysfs_create_group(&ipl_subsys.kset.kobj,
&ipl_fcp_attr_group);
if (rc)
goto out;
rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
&ipl_parameter_attr);
if (rc)
goto out_ipl_parm;
rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
&ipl_scp_data_attr);
if (!rc)
goto out;
sysfs_remove_bin_file(&ipl_subsys.kset.kobj, &ipl_parameter_attr);
out_ipl_parm:
sysfs_remove_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group);
out:
return rc;
}
static int __init static int __init
ipl_device_sysfs_register(void) { ipl_device_sysfs_register(void) {
int rc; int rc;
rc = firmware_register(&ipl_subsys); rc = firmware_register(&ipl_subsys);
if (rc) if (rc)
return rc; goto out;
switch (get_ipl_type()) { switch (get_ipl_type()) {
case ipl_type_ccw: case ipl_type_ccw:
sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_ccw_attr_group); rc = sysfs_create_group(&ipl_subsys.kset.kobj,
&ipl_ccw_attr_group);
break; break;
case ipl_type_fcp: case ipl_type_fcp:
sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group); rc = ipl_register_fcp_files();
sysfs_create_bin_file(&ipl_subsys.kset.kobj,
&ipl_parameter_attr);
sysfs_create_bin_file(&ipl_subsys.kset.kobj,
&ipl_scp_data_attr);
break; break;
default: default:
sysfs_create_group(&ipl_subsys.kset.kobj, rc = sysfs_create_group(&ipl_subsys.kset.kobj,
&ipl_unknown_attr_group); &ipl_unknown_attr_group);
break; break;
} }
return 0;
if (rc)
firmware_unregister(&ipl_subsys);
out:
return rc;
} }
__initcall(ipl_device_sysfs_register); __initcall(ipl_device_sysfs_register);
...@@ -304,6 +304,7 @@ static int __init xpram_setup_sizes(unsigned long pages) ...@@ -304,6 +304,7 @@ static int __init xpram_setup_sizes(unsigned long pages)
{ {
unsigned long mem_needed; unsigned long mem_needed;
unsigned long mem_auto; unsigned long mem_auto;
unsigned long long size;
int mem_auto_no; int mem_auto_no;
int i; int i;
...@@ -321,9 +322,19 @@ static int __init xpram_setup_sizes(unsigned long pages) ...@@ -321,9 +322,19 @@ static int __init xpram_setup_sizes(unsigned long pages)
mem_needed = 0; mem_needed = 0;
mem_auto_no = 0; mem_auto_no = 0;
for (i = 0; i < xpram_devs; i++) { for (i = 0; i < xpram_devs; i++) {
if (sizes[i]) if (sizes[i]) {
xpram_sizes[i] = size = simple_strtoull(sizes[i], &sizes[i], 0);
(memparse(sizes[i], &sizes[i]) + 3) & -4UL; switch (sizes[i][0]) {
case 'g':
case 'G':
size <<= 20;
break;
case 'm':
case 'M':
size <<= 10;
}
xpram_sizes[i] = (size + 3) & -4UL;
}
if (xpram_sizes[i]) if (xpram_sizes[i])
mem_needed += xpram_sizes[i]; mem_needed += xpram_sizes[i];
else else
......
...@@ -1106,10 +1106,10 @@ raw3270_delete_device(struct raw3270 *rp) ...@@ -1106,10 +1106,10 @@ raw3270_delete_device(struct raw3270 *rp)
/* Remove from device chain. */ /* Remove from device chain. */
mutex_lock(&raw3270_mutex); mutex_lock(&raw3270_mutex);
if (rp->clttydev) if (rp->clttydev && !IS_ERR(rp->clttydev))
class_device_destroy(class3270, class_device_destroy(class3270,
MKDEV(IBM_TTY3270_MAJOR, rp->minor)); MKDEV(IBM_TTY3270_MAJOR, rp->minor));
if (rp->cltubdev) if (rp->cltubdev && !IS_ERR(rp->cltubdev))
class_device_destroy(class3270, class_device_destroy(class3270,
MKDEV(IBM_FS3270_MAJOR, rp->minor)); MKDEV(IBM_FS3270_MAJOR, rp->minor));
list_del_init(&rp->list); list_del_init(&rp->list);
...@@ -1173,21 +1173,37 @@ static struct attribute_group raw3270_attr_group = { ...@@ -1173,21 +1173,37 @@ static struct attribute_group raw3270_attr_group = {
.attrs = raw3270_attrs, .attrs = raw3270_attrs,
}; };
static void static int raw3270_create_attributes(struct raw3270 *rp)
raw3270_create_attributes(struct raw3270 *rp)
{ {
//FIXME: check return code int rc;
sysfs_create_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
rp->clttydev = rc = sysfs_create_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
class_device_create(class3270, NULL, if (rc)
MKDEV(IBM_TTY3270_MAJOR, rp->minor), goto out;
&rp->cdev->dev, "tty%s",
rp->cdev->dev.bus_id); rp->clttydev = class_device_create(class3270, NULL,
rp->cltubdev = MKDEV(IBM_TTY3270_MAJOR, rp->minor),
class_device_create(class3270, NULL, &rp->cdev->dev, "tty%s",
MKDEV(IBM_FS3270_MAJOR, rp->minor), rp->cdev->dev.bus_id);
&rp->cdev->dev, "tub%s", if (IS_ERR(rp->clttydev)) {
rp->cdev->dev.bus_id); rc = PTR_ERR(rp->clttydev);
goto out_ttydev;
}
rp->cltubdev = class_device_create(class3270, NULL,
MKDEV(IBM_FS3270_MAJOR, rp->minor),
&rp->cdev->dev, "tub%s",
rp->cdev->dev.bus_id);
if (!IS_ERR(rp->cltubdev))
goto out;
rc = PTR_ERR(rp->cltubdev);
class_device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor));
out_ttydev:
sysfs_remove_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
out:
return rc;
} }
/* /*
...@@ -1255,7 +1271,9 @@ raw3270_set_online (struct ccw_device *cdev) ...@@ -1255,7 +1271,9 @@ raw3270_set_online (struct ccw_device *cdev)
rc = raw3270_reset_device(rp); rc = raw3270_reset_device(rp);
if (rc) if (rc)
goto failure; goto failure;
raw3270_create_attributes(rp); rc = raw3270_create_attributes(rp);
if (rc)
goto failure;
set_bit(RAW3270_FLAGS_READY, &rp->flags); set_bit(RAW3270_FLAGS_READY, &rp->flags);
mutex_lock(&raw3270_mutex); mutex_lock(&raw3270_mutex);
list_for_each_entry(np, &raw3270_notifier, list) list_for_each_entry(np, &raw3270_notifier, list)
......
...@@ -76,14 +76,22 @@ struct tape_class_device *register_tape_dev( ...@@ -76,14 +76,22 @@ struct tape_class_device *register_tape_dev(
device, device,
"%s", tcd->device_name "%s", tcd->device_name
); );
sysfs_create_link( rc = PTR_ERR(tcd->class_device);
if (rc)
goto fail_with_cdev;
rc = sysfs_create_link(
&device->kobj, &device->kobj,
&tcd->class_device->kobj, &tcd->class_device->kobj,
tcd->mode_name tcd->mode_name
); );
if (rc)
goto fail_with_class_device;
return tcd; return tcd;
fail_with_class_device:
class_device_destroy(tape_class, tcd->char_device->dev);
fail_with_cdev: fail_with_cdev:
cdev_del(tcd->char_device); cdev_del(tcd->char_device);
......
...@@ -543,20 +543,24 @@ int ...@@ -543,20 +543,24 @@ int
tape_generic_probe(struct ccw_device *cdev) tape_generic_probe(struct ccw_device *cdev)
{ {
struct tape_device *device; struct tape_device *device;
int ret;
device = tape_alloc_device(); device = tape_alloc_device();
if (IS_ERR(device)) if (IS_ERR(device))
return -ENODEV; return -ENODEV;
PRINT_INFO("tape device %s found\n", cdev->dev.bus_id); ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
ret = sysfs_create_group(&cdev->dev.kobj, &tape_attr_group);
if (ret) {
tape_put_device(device);
PRINT_ERR("probe failed for tape device %s\n", cdev->dev.bus_id);
return ret;
}
cdev->dev.driver_data = device; cdev->dev.driver_data = device;
cdev->handler = __tape_do_irq;
device->cdev = cdev; device->cdev = cdev;
device->cdev_id = busid_to_int(cdev->dev.bus_id); device->cdev_id = busid_to_int(cdev->dev.bus_id);
cdev->handler = __tape_do_irq; PRINT_INFO("tape device %s found\n", cdev->dev.bus_id);
return ret;
ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
sysfs_create_group(&cdev->dev.kobj, &tape_attr_group);
return 0;
} }
static inline void static inline void
......
...@@ -1068,6 +1068,7 @@ cmb_show_avg_sample_interval(struct device *dev, struct device_attribute *attr, ...@@ -1068,6 +1068,7 @@ cmb_show_avg_sample_interval(struct device *dev, struct device_attribute *attr,
if (count) { if (count) {
interval = cmb_data->last_update - interval = cmb_data->last_update -
cdev->private->cmb_start_time; cdev->private->cmb_start_time;
interval = (interval * 1000) >> 12;
interval /= count; interval /= count;
} else } else
interval = -1; interval = -1;
......
...@@ -2686,9 +2686,17 @@ static struct attribute_group ctc_attr_group = { ...@@ -2686,9 +2686,17 @@ static struct attribute_group ctc_attr_group = {
static int static int
ctc_add_attributes(struct device *dev) ctc_add_attributes(struct device *dev)
{ {
device_create_file(dev, &dev_attr_loglevel); int rc;
device_create_file(dev, &dev_attr_stats);
return 0; rc = device_create_file(dev, &dev_attr_loglevel);
if (rc)
goto out;
rc = device_create_file(dev, &dev_attr_stats);
if (!rc)
goto out;
device_remove_file(dev, &dev_attr_loglevel);
out:
return rc;
} }
static void static void
...@@ -2901,7 +2909,12 @@ ctc_new_device(struct ccwgroup_device *cgdev) ...@@ -2901,7 +2909,12 @@ ctc_new_device(struct ccwgroup_device *cgdev)
goto out; goto out;
} }
ctc_add_attributes(&cgdev->dev); if (ctc_add_attributes(&cgdev->dev)) {
ctc_netdev_unregister(dev);
dev->priv = NULL;
ctc_free_netdevice(dev, 1);
goto out;
}
strlcpy(privptr->fsm->name, dev->name, sizeof (privptr->fsm->name)); strlcpy(privptr->fsm->name, dev->name, sizeof (privptr->fsm->name));
......
...@@ -8451,10 +8451,11 @@ __qeth_reboot_event_card(struct device *dev, void *data) ...@@ -8451,10 +8451,11 @@ __qeth_reboot_event_card(struct device *dev, void *data)
static int static int
qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
{ {
int ret;
driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL, ret = driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
__qeth_reboot_event_card); __qeth_reboot_event_card);
return NOTIFY_DONE; return ret ? NOTIFY_BAD : NOTIFY_DONE;
} }
......
...@@ -128,8 +128,13 @@ extern void account_system_vtime(struct task_struct *); ...@@ -128,8 +128,13 @@ extern void account_system_vtime(struct task_struct *);
#define nop() __asm__ __volatile__ ("nop") #define nop() __asm__ __volatile__ ("nop")
#define xchg(ptr,x) \ #define xchg(ptr,x) \
((__typeof__(*(ptr)))__xchg((unsigned long)(x),(void *)(ptr),sizeof(*(ptr)))) ({ \
__typeof__(*(ptr)) __ret; \
__ret = (__typeof__(*(ptr))) \
__xchg((unsigned long)(x), (void *)(ptr),sizeof(*(ptr))); \
__ret; \
})
static inline unsigned long __xchg(unsigned long x, void * ptr, int size) static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
{ {
......
...@@ -19,7 +19,7 @@ static inline cycles_t get_cycles(void) ...@@ -19,7 +19,7 @@ static inline cycles_t get_cycles(void)
{ {
cycles_t cycles; cycles_t cycles;
__asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); __asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
return cycles >> 2; return cycles >> 2;
} }
...@@ -27,7 +27,7 @@ static inline unsigned long long get_clock (void) ...@@ -27,7 +27,7 @@ static inline unsigned long long get_clock (void)
{ {
unsigned long long clk; unsigned long long clk;
__asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); __asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
return clk; return clk;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册