All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] platform/x86: Add custom surface3 platform device for controlling LID
@ 2017-01-12 14:09 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-01-12 14:09 UTC (permalink / raw)
  To: benjamin.tissoires; +Cc: platform-driver-x86

Hello Benjamin Tissoires,

The patch 3dda3b3798f9: "platform/x86: Add custom surface3 platform
device for controlling LID" from Nov 25, 2016, leads to the following
static checker warning:

	drivers/platform/x86/surface3-wmi.c:168 s3_wmi_check_platform_device()
	error: uninitialized symbol 'ts_adev'.

drivers/platform/x86/surface3-wmi.c
   140  static int s3_wmi_check_platform_device(struct device *dev, void *data)
   141  {
   142          struct acpi_device *adev, *ts_adev;
   143          acpi_handle handle;
   144          acpi_status status;
   145  
   146          /* ignore non ACPI devices */
   147          handle = ACPI_HANDLE(dev);
   148          if (!handle || acpi_bus_get_device(handle, &adev))
   149                  return 0;
   150  
   151          /* check for LID ACPI switch */
   152          if (!strcmp(ACPI_BUTTON_HID_LID, acpi_device_hid(adev))) {
   153                  s3_wmi.pnp0c0d_adev = adev;
   154                  return 0;
   155          }
   156  
   157          /* ignore non SPI controllers */
   158          if (strncmp(acpi_device_bid(adev), SPI_CTL_OBJ_NAME,
   159              strlen(SPI_CTL_OBJ_NAME)))
   160                  return 0;
   161  
   162          status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
   163                                       s3_wmi_attach_spi_device, NULL,
   164                                       &ts_adev, NULL);
                                              ^^^^^^^
It's complaining about if this function fails.

   165          if (ACPI_FAILURE(status))
   166                  dev_warn(dev, "failed to enumerate SPI slaves\n");
   167  
   168          if (!ts_adev)
   169                  return 0;
   170  
   171          s3_wmi.touchscreen_adev = ts_adev;
   172  
   173          return 0;
   174  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-12 14:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 14:09 [bug report] platform/x86: Add custom surface3 platform device for controlling LID Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.