From patchwork Wed Jun 28 23:44:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 106583 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp474546qge; Wed, 28 Jun 2017 16:45:05 -0700 (PDT) X-Received: by 10.84.178.101 with SMTP id y92mr14633884plb.116.1498693505058; Wed, 28 Jun 2017 16:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498693505; cv=none; d=google.com; s=arc-20160816; b=QTonS9NmEUGSfJGD4n10wtZSr9r1KzQkB1CFIO5VA7yxPgwctDrMVApaIDpP/AhETw 4HEmtpqo21RQEvlMnoqqsLymAJn2Q8Pl3nIIyCFqoWgqHG+DgR5p/+o3M8YOvRBgbS0l IcSq220RGwObsyT7glkoRNk6A5MedS/clSvG7Cm2LXMCGJ7k1UMLMfrFFIQplKM1+GN2 0z8hfFdbYd70ri+ThFIg3WUg6yM09WigS6UuZhkTV2s14Wg87xeWvZSHy16VTyH8wj7Q 93C3rLkyfhd3m1mvwMelMEJZX9/mkuD3yNHHyqRZgynvdd5N/XtQ2sFwnA1a71h4CaUj Isew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=b89/Q7WnysGlgpSCohVUE7Mufru+WLoTd7iEbjf6lnI=; b=ZKID5VzazpJzuXIvgkVCHnRIC+zI3R2jtvX6VJaXienRKfjQP9yB8bUMegvqpRzDkn oD6zEd6y58ms0g73EgCGYy00evOVL2cRUGoRxiAe2kbyLdL4/sXxwZF1ZCRXu6vEEStQ bemzpVDd/RqKuz1HVn8iAanWeZXAwqaco84qhDH59I+7BdXeeLcG+lFjvNYDNbgJR7Or jJspYomSyTff2KQSJ58sbHpHeIzXn9u7e1kcl4RGkLpCguosncca0LC0Jmpek/+CvkMj TEzXQ/LcwPLyyg2lhR17JTgzfW3yFUe6TOTrI/tGpOUXjJqV3z4uNvpwtV4PrHgnly53 LGYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=RkSm0co5; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si2296135pga.71.2017.06.28.16.45.04; Wed, 28 Jun 2017 16:45:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=RkSm0co5; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751553AbdF1XpD (ORCPT + 10 others); Wed, 28 Jun 2017 19:45:03 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:34631 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751533AbdF1XpC (ORCPT ); Wed, 28 Jun 2017 19:45:02 -0400 Received: by mail-pf0-f176.google.com with SMTP id s66so40875969pfs.1 for ; Wed, 28 Jun 2017 16:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=UoHpldqrjIf4m5UqCgQyIQ0orjeBXSoakE8/QiS33Ys=; b=RkSm0co5AIVRoU7EE89M69CGDH0S6agHFTFCI8o45p7nc+DM5qccwb8xB7dtw/MzQO dqpxgAKHMePwBpECA0vleDcvHfvrq4lyEhqGMKZMq3l6+ADDZ+YDZIX8Yg5vu0Je72Ik 6uNZ4s+ZzJpWfoaRcXfy20lLuvKnAxTfpqb/0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UoHpldqrjIf4m5UqCgQyIQ0orjeBXSoakE8/QiS33Ys=; b=t9cdvOJtciniW3DoYpT3UpVw7W2b9fra1phQ5YUX+LrZFNod2UHvRUaNQ7Srv0c5tO O7ulZ0WHQ82XoZYyqJIpNeyfZQzojKfHydztWeYfOmlUG3KmDpGmgrJ2MCGDuMAYGr9X LVhknIwDL9iAuMOdRVE98Jhz95O2xydPoanHkfODxjI5YRz0Ppl4ylUkSbzbHcITAxo0 mg0cWOzOOlseGq2vMZjJsfOsKY6fwEWmDVdGiUvnM+VC66QgX72c67Jimymza78+GQnx Jktk/fW9CdkVlbCofsLRuvgib0zilbqDhKXcdf/dpGT4aEJM7WldQjqe0Obtbf9pmU4D KOyg== X-Gm-Message-State: AKS2vOxuzxcFrx12SnbIJC6aQj3HoSCDjiUU0n82mS4HhKFegcJSm0mq v0e/GWEi12vCoEH3dRkuuw== X-Received: by 10.98.147.142 with SMTP id r14mr13382461pfk.168.1498693501619; Wed, 28 Jun 2017 16:45:01 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id u9sm7150601pfk.131.2017.06.28.16.45.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 16:45:00 -0700 (PDT) From: Bjorn Andersson To: Stephen Boyd Cc: Rob Clark , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] spmi: Include OF based modalias in device uevent Date: Wed, 28 Jun 2017 16:44:58 -0700 Message-Id: <20170628234458.7917-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Include the OF-based modalias in the uevent sent when registering SPMI devices, so that user space has a chance to autoload the kernel module for the device. Reported-by: Rob Clark Signed-off-by: Bjorn Andersson --- Based on the MODULE_ALIAS in the qcom-spmi-pmic it's likely that the original author expected that the spmi-pmic-arb would create devices by the identifier "pmic" and the spmi code would include a MODALIAS="spmi:pmic" in the uevent. drivers/spmi/spmi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Tested-by: Rob Clark diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c index 2b9b0941d9eb..6d23226e5f69 100644 --- a/drivers/spmi/spmi.c +++ b/drivers/spmi/spmi.c @@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev) return 0; } +static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + int ret; + + ret = of_device_uevent_modalias(dev, env); + if (ret != -ENODEV) + return ret; + + return 0; +} + static struct bus_type spmi_bus_type = { .name = "spmi", .match = spmi_device_match, .probe = spmi_drv_probe, .remove = spmi_drv_remove, + .uevent = spmi_drv_uevent, }; /**