Skip to content

Commit

Permalink
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Do not try to disable hpet if it hasn't been initialized before
  x86, i8259: Only register sysdev if we have a real 8259 PIC
  • Loading branch information
Linus Torvalds committed Jul 26, 2010
2 parents ee13cbd + ff48780 commit 1a041a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ fs_initcall(hpet_late_init);

void hpet_disable(void)
{
if (is_hpet_capable()) {
if (is_hpet_capable() && hpet_virt_address) {
unsigned int cfg = hpet_readl(HPET_CFG);

if (hpet_legacy_int_enabled) {
Expand Down
25 changes: 15 additions & 10 deletions arch/x86/kernel/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,6 @@ static struct sys_device device_i8259A = {
.cls = &i8259_sysdev_class,
};

static int __init i8259A_init_sysfs(void)
{
int error = sysdev_class_register(&i8259_sysdev_class);
if (!error)
error = sysdev_register(&device_i8259A);
return error;
}

device_initcall(i8259A_init_sysfs);

static void mask_8259A(void)
{
unsigned long flags;
Expand Down Expand Up @@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = {
};

struct legacy_pic *legacy_pic = &default_legacy_pic;

static int __init i8259A_init_sysfs(void)
{
int error;

if (legacy_pic != &default_legacy_pic)
return 0;

error = sysdev_class_register(&i8259_sysdev_class);
if (!error)
error = sysdev_register(&device_i8259A);
return error;
}

device_initcall(i8259A_init_sysfs);

0 comments on commit 1a041a2

Please sign in to comment.