1. 10 12月, 2009 3 次提交
    • A
      asus-acpi: Remove redundant NULL checks · 2d5db0be
      Alan Jenkins 提交于
      The acpi device callbacks add, start, remove, suspend and resume can
      never be called with a NULL acpi_device. Each callsite in acpi/scan.c
      has to dereference the device in order to get the ops structure, e.g.
      
          struct acpi_device *acpi_dev = to_acpi_device(dev);
          struct acpi_driver *acpi_drv = acpi_dev->driver;
      
          if (acpi_drv && acpi_drv->ops.suspend)
              return acpi_drv->ops.suspend(acpi_dev, state);
      
      Remove all checks for acpi_dev == NULL within these callbacks.
      
      Also remove the checks for acpi_driver_data(acpi_dev) == NULL. None of
      these checks could fail unless the driver does something strange
      (which none of them do), the acpi core did something terribly wrong,
      or we have a memory corruption issue. If this does happen then it's
      best to dereference the pointer and crash noisily.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      2d5db0be
    • A
      asus-laptop: Remove redundant NULL checks · 1df8d8d4
      Alan Jenkins 提交于
      The acpi device callbacks add, start, remove, suspend and resume can
      never be called with a NULL acpi_device. Each callsite in acpi/scan.c
      has to dereference the device in order to get the ops structure, e.g.
      
          struct acpi_device *acpi_dev = to_acpi_device(dev);
          struct acpi_driver *acpi_drv = acpi_dev->driver;
      
          if (acpi_drv && acpi_drv->ops.suspend)
              return acpi_drv->ops.suspend(acpi_dev, state);
      
      Remove all checks for acpi_dev == NULL within these callbacks.
      
      Also remove the checks for acpi_driver_data(acpi_dev) == NULL. None of
      these checks could fail unless the driver does something strange
      (which none of them do), the acpi core did something terribly wrong,
      or we have a memory corruption issue. If this does happen then it's
      best to dereference the pointer and crash noisily.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      1df8d8d4
    • A
      eeepc-laptop: disp attribute should be write-only · 6dff29b6
      Alan Jenkins 提交于
      Currently, reading from the disp attribute fails with "No such device",
      which is misleading. According to CMSG table on acpi4asus project site,
      no models have a getter method corresponding to SDSP. Change the file
      permission to disallow reads.
      
      If some joker changes the permission to permit reads, then return -EIO
      to be consistent with sysfs' behaviour when no show() method is
      provided.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NCorentin Chary <corentincj@iksaif.net>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      6dff29b6
  2. 03 12月, 2009 15 次提交
  3. 02 12月, 2009 22 次提交