Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2011 07:17:02 +0000 (21:17 -1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2011 07:17:02 +0000 (21:17 -1000)
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (28 commits)
  ACPI:  delete stale reference in kernel-parameters.txt
  ACPI: add missing _OSI strings
  ACPI: remove NID_INVAL
  thermal: make THERMAL_HWMON implementation fully internal
  thermal: split hwmon lookup to a separate function
  thermal: hide CONFIG_THERMAL_HWMON
  ACPI print OSI(Linux) warning only once
  ACPI: DMI workaround for Asus A8N-SLI Premium and Asus A8N-SLI DELUX
  ACPI / Battery: propagate sysfs error in acpi_battery_add()
  ACPI / Battery: avoid acpi_battery_add() use-after-free
  ACPI: introduce "acpi_rsdp=" parameter for kdump
  ACPI: constify ops structs
  ACPI: fix CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS
  ACPI: fix 80 char overflow
  ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()
  ACPI / Battery: Add the check before refresh sysfs in the battery_notify()
  ACPI / Battery: Add the hibernation process in the battery_notify()
  ACPI / Battery: Rename acpi_battery_quirks2 with acpi_battery_quirks
  ACPI / Battery: Change 16-bit signed negative battery current into correct value
  ACPI / Battery: Add the power unit macro
  ...

1  2 
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
drivers/acpi/battery.c
drivers/acpi/sbs.c
drivers/acpi/video.c
drivers/ata/libata-acpi.c

@@@ -184,7 -184,7 +184,7 @@@ Why:       /proc/<pid>/oom_adj allows userspa
  
        A much more powerful interface, /proc/<pid>/oom_score_adj, was
        introduced with the oom killer rewrite that allows users to increase or
 -      decrease the badness() score linearly.  This interface will replace
 +      decrease the badness score linearly.  This interface will replace
        /proc/<pid>/oom_adj.
  
        A warning will be emitted to the kernel log if an application uses this
  
  ---------------------------
  
 -What: CS5535/CS5536 obsolete GPIO driver
 -When: June 2011
 -Files:        drivers/staging/cs5535_gpio/*
 -Check:        drivers/staging/cs5535_gpio/cs5535_gpio.c
 -Why:  A newer driver replaces this; it is drivers/gpio/cs5535-gpio.c, and
 -      integrates with the Linux GPIO subsystem.  The old driver has been
 -      moved to staging, and will be removed altogether around 2.6.40.
 -      Please test the new driver, and ensure that the functionality you
 -      need and any bugfixes from the old driver are available in the new
 -      one.
 -Who:  Andres Salomon <dilinger@queued.net>
 -
 ---------------------------
 -
  What: remove EXPORT_SYMBOL(kernel_thread)
  When: August 2006
  Files:        arch/*/kernel/*_ksyms.c
@@@ -280,7 -294,7 +280,7 @@@ When:      The schedule was July 2008, but i
  Why:  The support code for the old firmware hurts code readability/maintainability
        and slightly hurts runtime performance. Bugfixes for the old firmware
        are not provided by Broadcom anymore.
 -Who:  Michael Buesch <mb@bu3sch.de>
 +Who:  Michael Buesch <m@bues.ch>
  
  ---------------------------
  
@@@ -296,15 -310,6 +296,6 @@@ Who:      Ravikiran Thirumalai <kiran@scalex
  
  ---------------------------
  
- What: CONFIG_THERMAL_HWMON
- When: January 2009
- Why:  This option was introduced just to allow older lm-sensors userspace
-       to keep working over the upgrade to 2.6.26. At the scheduled time of
-       removal fixed lm-sensors (2.x or 3.x) should be readily available.
- Who:  Rene Herman <rene.herman@gmail.com>
- ---------------------------
  What: Code that is now under CONFIG_WIRELESS_EXT_SYSFS
        (in net/core/net-sysfs.c)
  When: After the only user (hal) has seen a release with the patches
@@@ -416,7 -421,7 +407,7 @@@ Who:       Avi Kivity <avi@redhat.com
  ----------------------------
  
  What: iwlwifi 50XX module parameters
 -When: 2.6.40
 +When: 3.0
  Why:  The "..50" modules parameters were used to configure 5000 series and
        up devices; different set of module parameters also available for 4965
        with same functionalities. Consolidate both set into single place
@@@ -427,7 -432,7 +418,7 @@@ Who:       Wey-Yi Guy <wey-yi.w.guy@intel.com
  ----------------------------
  
  What: iwl4965 alias support
 -When: 2.6.40
 +When: 3.0
  Why:  Internal alias support has been present in module-init-tools for some
        time, the MODULE_ALIAS("iwl4965") boilerplate aliases can be removed
        with no impact.
@@@ -460,8 -465,15 +451,8 @@@ Who:      FUJITA Tomonori <fujita.tomonori@l
  
  ----------------------------
  
 -What:         DMA_xxBIT_MASK macros
 -When: Jun 2011
 -Why:  DMA_xxBIT_MASK macros were replaced with DMA_BIT_MASK() macros.
 -Who:  FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
 -
 -----------------------------
 -
  What: iwlwifi disable_hw_scan module parameters
 -When: 2.6.40
 +When: 3.0
  Why:  Hareware scan is the prefer method for iwlwifi devices for
        scanning operation. Remove software scan support for all the
        iwlwifi devices.
@@@ -470,6 -482,26 +461,6 @@@ Who:      Wey-Yi Guy <wey-yi.w.guy@intel.com
  
  ----------------------------
  
 -What:   access to nfsd auth cache through sys_nfsservctl or '.' files
 -        in the 'nfsd' filesystem.
 -When:   2.6.40
 -Why:    This is a legacy interface which have been replaced by a more
 -        dynamic cache.  Continuing to maintain this interface is an
 -        unnecessary burden.
 -Who:    NeilBrown <neilb@suse.de>
 -
 -----------------------------
 -
 -What: cancel_rearming_delayed_work[queue]()
 -When: 2.6.39
 -
 -Why:  The functions have been superceded by cancel_delayed_work_sync()
 -      quite some time ago.  The conversion is trivial and there is no
 -      in-kernel user left.
 -Who:  Tejun Heo <tj@kernel.org>
 -
 -----------------------------
 -
  What: Legacy, non-standard chassis intrusion detection interface.
  When: June 2011
  Why:  The adm9240, w83792d and w83793 hardware monitoring drivers have
@@@ -487,6 -519,22 +478,6 @@@ Files:    net/netfilter/xt_connlimit.
  
  ----------------------------
  
 -What: noswapaccount kernel command line parameter
 -When: 2.6.40
 -Why:  The original implementation of memsw feature enabled by
 -      CONFIG_CGROUP_MEM_RES_CTLR_SWAP could be disabled by the noswapaccount
 -      kernel parameter (introduced in 2.6.29-rc1). Later on, this decision
 -      turned out to be not ideal because we cannot have the feature compiled
 -      in and disabled by default and let only interested to enable it
 -      (e.g. general distribution kernels might need it). Therefore we have
 -      added swapaccount[=0|1] parameter (introduced in 2.6.37) which provides
 -      the both possibilities. If we remove noswapaccount we will have
 -      less command line parameters with the same functionality and we
 -      can also cleanup the parameter handling a bit ().
 -Who:  Michal Hocko <mhocko@suse.cz>
 -
 -----------------------------
 -
  What: ipt_addrtype match include file
  When: 2012
  Why:  superseded by xt_addrtype
@@@ -505,7 -553,7 +496,7 @@@ Who:       Jean Delvare <khali@linux-fr.org
  ----------------------------
  
  What: Support for UVCIOC_CTRL_ADD in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  The information passed to the driver by this ioctl is now queried
        dynamically from the device.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  ----------------------------
  
  What: Support for UVCIOC_CTRL_MAP_OLD in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  Used only by applications compiled against older driver versions.
        Superseded by UVCIOC_CTRL_MAP which supports V4L2 menu controls.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  ----------------------------
  
  What: Support for UVCIOC_CTRL_GET and UVCIOC_CTRL_SET in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  Superseded by the UVCIOC_CTRL_QUERY ioctl.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  
  ----------------------------
  
 +What: Support for driver specific ioctls in the pwc driver (everything
 +      defined in media/pwc-ioctl.h)
 +When: 3.3
 +Why:  This stems from the v4l1 era, with v4l2 everything can be done with
 +      standardized v4l2 API calls
 +Who:  Hans de Goede <hdegoede@redhat.com>
 +
 +----------------------------
 +
 +What: Driver specific sysfs API in the pwc driver
 +When: 3.3
 +Why:  Setting pan/tilt should be done with v4l2 controls, like with other
 +      cams. The button is available as a standard input device
 +Who:  Hans de Goede <hdegoede@redhat.com>
 +
 +----------------------------
 +
 +What: Driver specific use of pixfmt.priv in the pwc driver
 +When: 3.3
 +Why:  The .priv field never was intended for this, setting a framerate is
 +      support using the standardized S_PARM ioctl
 +Who:  Hans de Goede <hdegoede@redhat.com>
 +
 +----------------------------
 +
 +What: Software emulation of arbritary resolutions in the pwc driver
 +When: 3.3
 +Why:  The pwc driver claims to support any resolution between 160x120
 +      and 640x480, but emulates this by simply drawing a black border
 +      around the image. Userspace can draw its own black border if it
 +      really wants one.
 +Who:  Hans de Goede <hdegoede@redhat.com>
 +
 +----------------------------
 +
  What: For VIDIOC_S_FREQUENCY the type field must match the device node's type.
        If not, return -EINVAL.
  When: 3.2
@@@ -583,10 -596,3 +574,10 @@@ Why:     Just opening a V4L device should n
  Who:  Hans Verkuil <hans.verkuil@cisco.com>
  
  ----------------------------
 +
 +What: g_file_storage driver
 +When: 3.8
 +Why:  This driver has been superseded by g_mass_storage.
 +Who:  Alan Stern <stern@rowland.harvard.edu>
 +
 +----------------------------
@@@ -163,6 -163,11 +163,11 @@@ bytes respectively. Such letter suffixe
  
                        See also Documentation/power/pm.txt, pci=noacpi
  
+       acpi_rsdp=      [ACPI,EFI,KEXEC]
+                       Pass the RSDP address to the kernel, mostly used
+                       on machines running EFI runtime service to boot the
+                       second kernel for kdump.
        acpi_apic_instance=     [ACPI, IOAPIC]
                        Format: <int>
                        2: use 2nd APIC table, if available
                        for all guests.
                        Default is 1 (enabled) if in 64bit or 32bit-PAE mode
  
 -      kvm-intel.bypass_guest_pf=
 -                      [KVM,Intel] Disables bypassing of guest page faults
 -                      on Intel chips. Default is 1 (enabled)
 -
        kvm-intel.ept=  [KVM,Intel] Disable extended page tables
                        (virtualized MMU) support on capable Intel chips.
                        Default is 1 (enabled)
        no-kvmapf       [X86,KVM] Disable paravirtualized asynchronous page
                        fault handling.
  
 +      no-steal-acc    [X86,KVM] Disable paravirtualized steal time accounting.
 +                      steal time is computed, but won't influence scheduler
 +                      behaviour
 +
        nolapic         [X86-32,APIC] Do not enable or use the local APIC.
  
        nolapic_timer   [X86-32,APIC] Do not use the local APIC timer.
                        See Documentation/sound/oss/oss-parameters.txt
  
        panic=          [KNL] Kernel behaviour on panic: delay <timeout>
 -                      seconds before rebooting
 +                      timeout > 0: seconds before rebooting
 +                      timeout = 0: wait forever
 +                      timeout < 0: reboot immediately
                        Format: <timeout>
  
        parkbd.port=    [HW] Parallel port number the keyboard adapter is
                        [HW,MOUSE] Controls Logitech smartscroll autorepeat.
                        0 = disabled, 1 = enabled (default).
  
 +      pstore.backend= Specify the name of the pstore backend to use
 +
        pt.             [PARIDE]
                        See Documentation/blockdev/paride.txt.
  
                        <port#>,<js1>,<js2>,<js3>,<js4>,<js5>,<js6>,<js7>
                        See also Documentation/input/joystick-parport.txt
  
 +      udbg-immortal   [PPC] When debugging early kernel crashes that
 +                      happen after console_init() and before a proper 
 +                      console driver takes over, this boot options might
 +                      help "seeing" what's going on.
 +
        uhash_entries=  [KNL,NET]
                        Set number of hash buckets for UDP/UDP-Lite connections
  
        unknown_nmi_panic
                        [X86] Cause panic on unknown NMI.
  
 +      usbcore.authorized_default=
 +                      [USB] Default USB device authorization:
 +                      (default -1 = authorized except for wireless USB,
 +                      0 = not authorized, 1 = authorized)
 +
        usbcore.autosuspend=
                        [USB] The autosuspend time delay (in seconds) used
                        for newly-detected USB devices (default 2).  This
diff --combined drivers/acpi/battery.c
@@@ -55,6 -55,9 +55,9 @@@
  #define ACPI_BATTERY_NOTIFY_INFO      0x81
  #define ACPI_BATTERY_NOTIFY_THRESHOLD   0x82
  
+ /* Battery power unit: 0 means mW, 1 means mA */
+ #define ACPI_BATTERY_POWER_UNIT_MA    1
  #define _COMPONENT            ACPI_BATTERY_COMPONENT
  
  ACPI_MODULE_NAME("battery");
@@@ -91,11 -94,6 +94,6 @@@ MODULE_DEVICE_TABLE(acpi, battery_devic
  enum {
        ACPI_BATTERY_ALARM_PRESENT,
        ACPI_BATTERY_XINFO_PRESENT,
-       /* For buggy DSDTs that report negative 16-bit values for either
-        * charging or discharging current and/or report 0 as 65536
-        * due to bad math.
-        */
-       ACPI_BATTERY_QUIRK_SIGNED16_CURRENT,
        ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY,
  };
  
@@@ -132,7 -130,7 +130,7 @@@ struct acpi_battery 
        unsigned long flags;
  };
  
 -#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
 +#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat)
  
  inline int acpi_battery_present(struct acpi_battery *battery)
  {
@@@ -301,7 -299,8 +299,8 @@@ static enum power_supply_property energ
  #ifdef CONFIG_ACPI_PROCFS_POWER
  inline char *acpi_battery_units(struct acpi_battery *battery)
  {
-       return (battery->power_unit)?"mA":"mW";
+       return (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA) ?
+               "mA" : "mW";
  }
  #endif
  
@@@ -461,9 -460,17 +460,17 @@@ static int acpi_battery_get_state(struc
        battery->update_time = jiffies;
        kfree(buffer.pointer);
  
-       if (test_bit(ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, &battery->flags) &&
-           battery->rate_now != -1)
+       /* For buggy DSDTs that report negative 16-bit values for either
+        * charging or discharging current and/or report 0 as 65536
+        * due to bad math.
+        */
+       if (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA &&
+               battery->rate_now != ACPI_BATTERY_VALUE_UNKNOWN &&
+               (s16)(battery->rate_now) < 0) {
                battery->rate_now = abs((s16)battery->rate_now);
+               printk_once(KERN_WARNING FW_BUG "battery: (dis)charge rate"
+                       " invalid.\n");
+       }
  
        if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)
            && battery->capacity_now >= 0 && battery->capacity_now <= 100)
@@@ -544,7 -551,7 +551,7 @@@ static int sysfs_add_battery(struct acp
  {
        int result;
  
-       if (battery->power_unit) {
+       if (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA) {
                battery->bat.properties = charge_battery_props;
                battery->bat.num_properties =
                        ARRAY_SIZE(charge_battery_props);
  
  static void sysfs_remove_battery(struct acpi_battery *battery)
  {
-       if (!battery->bat.dev)
+       mutex_lock(&battery->lock);
+       if (!battery->bat.dev) {
+               mutex_unlock(&battery->lock);
                return;
+       }
        device_remove_file(battery->bat.dev, &alarm_attr);
        power_supply_unregister(&battery->bat);
        battery->bat.dev = NULL;
- }
- static void acpi_battery_quirks(struct acpi_battery *battery)
- {
-       if (dmi_name_in_vendors("Acer") && battery->power_unit) {
-               set_bit(ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, &battery->flags);
-       }
+       mutex_unlock(&battery->lock);
  }
  
  /*
   *
   * Handle this correctly so that they won't break userspace.
   */
- static void acpi_battery_quirks2(struct acpi_battery *battery)
+ static void acpi_battery_quirks(struct acpi_battery *battery)
  {
        if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
                return ;
@@@ -623,13 -628,15 +628,15 @@@ static int acpi_battery_update(struct a
                result = acpi_battery_get_info(battery);
                if (result)
                        return result;
-               acpi_battery_quirks(battery);
                acpi_battery_init_alarm(battery);
        }
-       if (!battery->bat.dev)
-               sysfs_add_battery(battery);
+       if (!battery->bat.dev) {
+               result = sysfs_add_battery(battery);
+               if (result)
+                       return result;
+       }
        result = acpi_battery_get_state(battery);
-       acpi_battery_quirks2(battery);
+       acpi_battery_quirks(battery);
        return result;
  }
  
@@@ -863,7 -870,7 +870,7 @@@ DECLARE_FILE_FUNCTIONS(alarm)
                }, \
        }
  
- static struct battery_file {
+ static const struct battery_file {
        struct file_operations ops;
        mode_t mode;
        const char *name;
@@@ -948,9 -955,12 +955,12 @@@ static int battery_notify(struct notifi
        struct acpi_battery *battery = container_of(nb, struct acpi_battery,
                                                    pm_nb);
        switch (mode) {
+       case PM_POST_HIBERNATION:
        case PM_POST_SUSPEND:
-               sysfs_remove_battery(battery);
-               sysfs_add_battery(battery);
+               if (battery->bat.dev) {
+                       sysfs_remove_battery(battery);
+                       sysfs_add_battery(battery);
+               }
                break;
        }
  
@@@ -975,25 -985,33 +985,33 @@@ static int acpi_battery_add(struct acpi
        if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle,
                        "_BIX", &handle)))
                set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);
-       acpi_battery_update(battery);
+       result = acpi_battery_update(battery);
+       if (result)
+               goto fail;
  #ifdef CONFIG_ACPI_PROCFS_POWER
        result = acpi_battery_add_fs(device);
  #endif
-       if (!result) {
-               printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
-                       ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
-                       device->status.battery_present ? "present" : "absent");
-       } else {
+       if (result) {
  #ifdef CONFIG_ACPI_PROCFS_POWER
                acpi_battery_remove_fs(device);
  #endif
-               kfree(battery);
+               goto fail;
        }
  
+       printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
+               ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
+               device->status.battery_present ? "present" : "absent");
        battery->pm_nb.notifier_call = battery_notify;
        register_pm_notifier(&battery->pm_nb);
  
        return result;
+ fail:
+       sysfs_remove_battery(battery);
+       mutex_destroy(&battery->lock);
+       kfree(battery);
+       return result;
  }
  
  static int acpi_battery_remove(struct acpi_device *device, int type)
diff --combined drivers/acpi/sbs.c
@@@ -112,7 -112,7 +112,7 @@@ struct acpi_battery 
        u8 have_sysfs_alarm:1;
  };
  
 -#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
 +#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat)
  
  struct acpi_sbs {
        struct power_supply charger;
  
  #define to_acpi_sbs(x) container_of(x, struct acpi_sbs, charger)
  
+ static int acpi_sbs_remove(struct acpi_device *device, int type);
+ static int acpi_battery_get_state(struct acpi_battery *battery);
  static inline int battery_scale(int log)
  {
        int scale = 1;
@@@ -195,6 -198,8 +198,8 @@@ static int acpi_sbs_battery_get_propert
  
        if ((!battery->present) && psp != POWER_SUPPLY_PROP_PRESENT)
                return -ENODEV;
+       acpi_battery_get_state(battery);
        switch (psp) {
        case POWER_SUPPLY_PROP_STATUS:
                if (battery->rate_now < 0)
        case POWER_SUPPLY_PROP_POWER_NOW:
                val->intval = abs(battery->rate_now) *
                                acpi_battery_ipscale(battery) * 1000;
+               val->intval *= (acpi_battery_mode(battery)) ?
+                               (battery->voltage_now *
+                               acpi_battery_vscale(battery) / 1000) : 1;
                break;
        case POWER_SUPPLY_PROP_CURRENT_AVG:
        case POWER_SUPPLY_PROP_POWER_AVG:
                val->intval = abs(battery->rate_avg) *
                                acpi_battery_ipscale(battery) * 1000;
+               val->intval *= (acpi_battery_mode(battery)) ?
+                               (battery->voltage_now *
+                               acpi_battery_vscale(battery) / 1000) : 1;
                break;
        case POWER_SUPPLY_PROP_CAPACITY:
                val->intval = battery->state_of_charge;
@@@ -903,8 -914,6 +914,6 @@@ static void acpi_sbs_callback(void *con
        }
  }
  
- static int acpi_sbs_remove(struct acpi_device *device, int type);
  static int acpi_sbs_add(struct acpi_device *device)
  {
        struct acpi_sbs *sbs;
diff --combined drivers/acpi/video.c
@@@ -46,6 -46,7 +46,6 @@@
  
  #define PREFIX "ACPI: "
  
 -#define ACPI_VIDEO_CLASS              "video"
  #define ACPI_VIDEO_BUS_NAME           "Video Bus"
  #define ACPI_VIDEO_DEVICE_NAME                "Video Device"
  #define ACPI_VIDEO_NOTIFY_SWITCH      0x80
@@@ -307,7 -308,7 +307,7 @@@ video_set_cur_state(struct thermal_cool
        return acpi_video_device_lcd_set_level(video, level);
  }
  
- static struct thermal_cooling_device_ops video_cooling_ops = {
+ static const struct thermal_cooling_device_ops video_cooling_ops = {
        .get_max_state = video_get_max_state,
        .get_cur_state = video_get_cur_state,
        .set_cur_state = video_set_cur_state,
@@@ -1444,8 -1445,7 +1444,8 @@@ static void acpi_video_bus_notify(struc
        case ACPI_VIDEO_NOTIFY_SWITCH:  /* User requested a switch,
                                         * most likely via hotkey. */
                acpi_bus_generate_proc_event(device, event, 0);
 -              keycode = KEY_SWITCHVIDEOMODE;
 +              if (!acpi_notifier_call_chain(device, event, 0))
 +                      keycode = KEY_SWITCHVIDEOMODE;
                break;
  
        case ACPI_VIDEO_NOTIFY_PROBE:   /* User plugged in or removed a video
                break;
        }
  
 -      acpi_notifier_call_chain(device, event, 0);
 +      if (event != ACPI_VIDEO_NOTIFY_SWITCH)
 +              acpi_notifier_call_chain(device, event, 0);
  
        if (keycode) {
                input_report_key(input, keycode, 1);
@@@ -218,12 -218,12 +218,12 @@@ static void ata_acpi_dev_uevent(acpi_ha
        ata_acpi_uevent(dev->link->ap, dev, event);
  }
  
- static struct acpi_dock_ops ata_acpi_dev_dock_ops = {
+ static const struct acpi_dock_ops ata_acpi_dev_dock_ops = {
        .handler = ata_acpi_dev_notify_dock,
        .uevent = ata_acpi_dev_uevent,
  };
  
- static struct acpi_dock_ops ata_acpi_ap_dock_ops = {
+ static const struct acpi_dock_ops ata_acpi_ap_dock_ops = {
        .handler = ata_acpi_ap_notify_dock,
        .uevent = ata_acpi_ap_uevent,
  };
@@@ -332,22 -332,25 +332,22 @@@ int ata_acpi_gtm(struct ata_port *ap, s
  
        rc = -EINVAL;
        if (ACPI_FAILURE(status)) {
 -              ata_port_printk(ap, KERN_ERR,
 -                              "ACPI get timing mode failed (AE 0x%x)\n",
 -                              status);
 +              ata_port_err(ap, "ACPI get timing mode failed (AE 0x%x)\n",
 +                           status);
                goto out_free;
        }
  
        out_obj = output.pointer;
        if (out_obj->type != ACPI_TYPE_BUFFER) {
 -              ata_port_printk(ap, KERN_WARNING,
 -                              "_GTM returned unexpected object type 0x%x\n",
 -                              out_obj->type);
 +              ata_port_warn(ap, "_GTM returned unexpected object type 0x%x\n",
 +                            out_obj->type);
  
                goto out_free;
        }
  
        if (out_obj->buffer.length != sizeof(struct ata_acpi_gtm)) {
 -              ata_port_printk(ap, KERN_ERR,
 -                              "_GTM returned invalid length %d\n",
 -                              out_obj->buffer.length);
 +              ata_port_err(ap, "_GTM returned invalid length %d\n",
 +                           out_obj->buffer.length);
                goto out_free;
        }
  
@@@ -399,8 -402,8 +399,8 @@@ int ata_acpi_stm(struct ata_port *ap, c
        if (status == AE_NOT_FOUND)
                return -ENOENT;
        if (ACPI_FAILURE(status)) {
 -              ata_port_printk(ap, KERN_ERR,
 -                      "ACPI set timing mode failed (status=0x%x)\n", status);
 +              ata_port_err(ap, "ACPI set timing mode failed (status=0x%x)\n",
 +                           status);
                return -EINVAL;
        }
        return 0;
@@@ -447,8 -450,8 +447,8 @@@ static int ata_dev_get_GTF(struct ata_d
        output.pointer = NULL;  /* ACPI-CA sets this; save/free it later */
  
        if (ata_msg_probe(ap))
 -              ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n",
 -                             __func__, ap->port_no);
 +              ata_dev_dbg(dev, "%s: ENTER: port#: %d\n",
 +                          __func__, ap->port_no);
  
        /* _GTF has no input parameters */
        status = acpi_evaluate_object(dev->acpi_handle, "_GTF", NULL, &output);
  
        if (ACPI_FAILURE(status)) {
                if (status != AE_NOT_FOUND) {
 -                      ata_dev_printk(dev, KERN_WARNING,
 -                                     "_GTF evaluation failed (AE 0x%x)\n",
 -                                     status);
 +                      ata_dev_warn(dev, "_GTF evaluation failed (AE 0x%x)\n",
 +                                   status);
                        rc = -EINVAL;
                }
                goto out_free;
  
        if (!output.length || !output.pointer) {
                if (ata_msg_probe(ap))
 -                      ata_dev_printk(dev, KERN_DEBUG, "%s: Run _GTF: "
 -                              "length or ptr is NULL (0x%llx, 0x%p)\n",
 -                              __func__,
 -                              (unsigned long long)output.length,
 -                              output.pointer);
 +                      ata_dev_dbg(dev, "%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n",
 +                                  __func__,
 +                                  (unsigned long long)output.length,
 +                                  output.pointer);
                rc = -EINVAL;
                goto out_free;
        }
  
        if (out_obj->type != ACPI_TYPE_BUFFER) {
 -              ata_dev_printk(dev, KERN_WARNING,
 -                             "_GTF unexpected object type 0x%x\n",
 -                             out_obj->type);
 +              ata_dev_warn(dev, "_GTF unexpected object type 0x%x\n",
 +                           out_obj->type);
                rc = -EINVAL;
                goto out_free;
        }
  
        if (out_obj->buffer.length % REGS_PER_GTF) {
 -              ata_dev_printk(dev, KERN_WARNING,
 -                             "unexpected _GTF length (%d)\n",
 -                             out_obj->buffer.length);
 +              ata_dev_warn(dev, "unexpected _GTF length (%d)\n",
 +                           out_obj->buffer.length);
                rc = -EINVAL;
                goto out_free;
        }
        if (gtf) {
                *gtf = (void *)out_obj->buffer.pointer;
                if (ata_msg_probe(ap))
 -                      ata_dev_printk(dev, KERN_DEBUG,
 -                                     "%s: returning gtf=%p, gtf_count=%d\n",
 -                                     __func__, *gtf, rc);
 +                      ata_dev_dbg(dev, "%s: returning gtf=%p, gtf_count=%d\n",
 +                                  __func__, *gtf, rc);
        }
        return rc;
  
@@@ -803,8 -811,8 +803,8 @@@ static int ata_acpi_push_id(struct ata_
        union acpi_object in_params[1];
  
        if (ata_msg_probe(ap))
 -              ata_dev_printk(dev, KERN_DEBUG, "%s: ix = %d, port#: %d\n",
 -                             __func__, dev->devno, ap->port_no);
 +              ata_dev_dbg(dev, "%s: ix = %d, port#: %d\n",
 +                          __func__, dev->devno, ap->port_no);
  
        /* Give the drive Identify data to the drive via the _SDD method */
        /* _SDD: set up input parameters */
                return -ENOENT;
  
        if (ACPI_FAILURE(status)) {
 -              ata_dev_printk(dev, KERN_WARNING,
 -                             "ACPI _SDD failed (AE 0x%x)\n", status);
 +              ata_dev_warn(dev, "ACPI _SDD failed (AE 0x%x)\n", status);
                return -EIO;
        }
  
@@@ -974,8 -983,8 +974,8 @@@ int ata_acpi_on_devcfg(struct ata_devic
        if (nr_executed) {
                rc = ata_dev_reread_id(dev, 0);
                if (rc < 0) {
 -                      ata_dev_printk(dev, KERN_ERR, "failed to IDENTIFY "
 -                                     "after ACPI commands\n");
 +                      ata_dev_err(dev,
 +                                  "failed to IDENTIFY after ACPI commands\n");
                        return rc;
                }
        }
                return rc;
        }
  
 -      ata_dev_printk(dev, KERN_WARNING,
 -                     "ACPI: failed the second time, disabled\n");
 +      ata_dev_warn(dev, "ACPI: failed the second time, disabled\n");
        dev->acpi_handle = NULL;
  
        /* We can safely continue if no _GTF command has been executed