From patchwork Sun Sep 16 23:45:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10601929 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5347713AD for ; Sun, 16 Sep 2018 23:46:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 431EB29340 for ; Sun, 16 Sep 2018 23:46:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37ADD2934C; Sun, 16 Sep 2018 23:46:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E152129340 for ; Sun, 16 Sep 2018 23:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbeIQFKj (ORCPT ); Mon, 17 Sep 2018 01:10:39 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41906 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726889AbeIQFKj (ORCPT ); Mon, 17 Sep 2018 01:10:39 -0400 Received: by mail-io1-f68.google.com with SMTP id q4-v6so10044991iob.8 for ; Sun, 16 Sep 2018 16:45:58 -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:in-reply-to:references; bh=QcoflERtpbbMpFHGfNLZf+J44DqlCQNeE1IN/AfmCyw=; b=QZ5CW7Fo4X2d5dWSsyibw1FewzAcVLqIfsIhOn4Di1qz3uJz15hTqBNSl6D//5Ki9q Eaa02bx8tJ+CixARxakw8c9gpyXYVTtppksrkOPfobracWgN3WG1hQ9GI5FqP3FlMSxp Ny/RKE7IIEv1qOa3nF/AotMXlPtBYPZGF8GaI= 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:in-reply-to :references; bh=QcoflERtpbbMpFHGfNLZf+J44DqlCQNeE1IN/AfmCyw=; b=rloO3TSMrehL/5dV1+6HXDvTY5dDS90hCQu7UCSTXgsGHPexGhuijvefg9AHU9WTAU 8Dg90cGGCX7XrGgirQRiC7n6YhB1QUIZu0nk7ItSH2NPxjpM7gMlVmUgHT84ub6M+JT/ WhFQk9E5mYRt9ubzZXw3AM8eqqQX5tBtBvMX9r7oFOAmfRfmCr4we5Wgr09dqvHvtK7a Nf06h6X2xOQcWjRus2PRAbZ2JK4oPJJUj0iuffKDFNDbgEGigZztiUbqR6dfkVgMAtOw jYDgt8WJ15O6/s1Y9Ias7y1eFYfJWbzXEeU3q0qcaidvtJngvJxm+reStjWdxSab+oIi qC7g== X-Gm-Message-State: APzg51AqcpEOrJCRQTXU3ahgY0nr7JizS1AEfYeNA5ciADHTXt18ka60 ugkueVCHnc4wbXc8CaV5/1TVzw== X-Google-Smtp-Source: ANB0VdZfaqPCa+jueB1u3F+i/YV6WKBSxekAl0eW6kTflKSfH9ugH2prhJyZ2i5B3D3T2T/EZe/Hjg== X-Received: by 2002:a6b:25d2:: with SMTP id l201-v6mr18710058iol.115.1537141558285; Sun, 16 Sep 2018 16:45:58 -0700 (PDT) Received: from localhost.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id a11-v6sm4495177ioc.63.2018.09.16.16.45.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Sep 2018 16:45:57 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: broonie@kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, vkoul@kernel.org, Srinivas Kandagatla Subject: [PATCH 1/7] slimbus: core: add support to uevent Date: Sun, 16 Sep 2018 16:45:40 -0700 Message-Id: <20180916234546.29661-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180916234546.29661-1-srinivas.kandagatla@linaro.org> References: <20180916234546.29661-1-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Srinivas Kandagatla This patch adds support to uevent to help automatic module loading. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index 95b00d2..31f2910 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include "slimbus.h" @@ -57,11 +58,24 @@ static int slim_device_remove(struct device *dev) return 0; } +static int slim_device_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + struct slim_device *sbdev = to_slim_device(dev); + int ret; + + ret = of_device_uevent_modalias(dev, env); + if (ret != -ENODEV) + return ret; + + return add_uevent_var(env, "MODALIAS=slim:%s", dev_name(&sbdev->dev)); +} + struct bus_type slimbus_bus = { .name = "slimbus", .match = slim_device_match, .probe = slim_device_probe, .remove = slim_device_remove, + .uevent = slim_device_uevent, }; EXPORT_SYMBOL_GPL(slimbus_bus);