Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3379156imm; Tue, 29 May 2018 06:20:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrQ1darzGAD89WNEDgAR7hJ1mpwvsxRE3SfJs9dYQRFXtBwD/fEQ8qb0c/vSDX9RWMJEeEN X-Received: by 2002:a63:7986:: with SMTP id u128-v6mr13764341pgc.127.1527600001851; Tue, 29 May 2018 06:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527600001; cv=none; d=google.com; s=arc-20160816; b=PfsOnfC6L5I50XWGQpl9GNjL+YLCRUq5iunfEcsKcuxU8mYLtu2dwqL/JA7879Y5N1 ScqDfvcK/RXQ4jdt9xYwfZvir2KMMg+PHynk4AFxOa9V8r4GL8M2U2BPAWDXEmDEAIwV k11beZYSkQVR8EDxEnEiXS9IQqqPOgMvIHMEhwjAbFtQvlerzJueyfqrOSZgOsVbdQSz ndC0USbtEh1PuvYZWXTnEWW0dVUKpNbGkF1z1WU72mtC0cY2RPrcno6RNvmRSUUVSFGW t4Tm7/iifpO55ot1qrBgaYLBwSJOLdvakNJiFPynPIpig1bQEWFN63GIXcpg8anFyxgV QKyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=p1bRPn9h8RRSRaiR77wI1UyH7PggxnW8fykNDidnc/k=; b=o4hN3XWprKqoTkD9ehbiREujwGq9MPpbKQjb9ocye36VNCuREjXZFNIukmW0TJ010f 1h/UwhvbIOON74wOyVwN+21Fw3TzXIRctqJwj+yQB3RXO9JCSLMqykE4LajAorkZL03i mwhX3M4e63yhg3GFEZrS4t81tpF04haU1i84jd4qgaEamKVllnKkIyXwsWvn0QEi/0t0 sCWL8/Puycnw6qCs2AIA0JXc2vT/IvGIZsk6JeUz9Rurl3fun54wtlu6v3DxMIzFaWNm qpillmuTL4rnG4lYaPMplj7EhWhhp8aYaLaws8lZHr24gPLTEQjpCSkfwh2BTdEHi+LT bBgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lZ9tWraz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f91-v6si32853643plb.510.2018.05.29.06.19.17; Tue, 29 May 2018 06:20:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lZ9tWraz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934616AbeE2NK4 (ORCPT + 99 others); Tue, 29 May 2018 09:10:56 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39937 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934552AbeE2NKr (ORCPT ); Tue, 29 May 2018 09:10:47 -0400 Received: by mail-wm0-f68.google.com with SMTP id x2-v6so33033263wmh.5; Tue, 29 May 2018 06:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p1bRPn9h8RRSRaiR77wI1UyH7PggxnW8fykNDidnc/k=; b=lZ9tWrazOqSpBncXwfmGvYE5mIdRLO3uweNgKGngIipYCtA7NoMR1j1NZXN3bpG6Na PFV2+moiaJ0J5gW5nADB5k9VOys0xZdPdqghjv8354Vb2WA3C+SVrFdc2wCcM0OMDBS3 4kHPwX5ZmtNve4D/L1rTpmrTEu6yjSEo2j7TdRsAzVsS+f7IomP1j/h7g0OiFtcp8z/N Q4ZQHfif1C7R1n1VIJwf1Z1Djrvq9TXxiu1Zu8ZtL8r7p978XSqwyxPUutPuQcfsTNe4 AJKtE27GChlFjfzeGal1eDmZ/xETuwx+d1pxPgpu0XEmY8XckAqVFksl8km8PFXXDVCG PHUQ== 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=p1bRPn9h8RRSRaiR77wI1UyH7PggxnW8fykNDidnc/k=; b=FMiMPF3SNW7jvSBrotFEvv3pdsQNB3TPzjCOF6wDEOCalftS+lj0U/uiutkZgdLIDU Um0dmnEikUxw7iTKdzaL4CMqfvLiPzuqL841Yv95LcA6JJ7UjOtl1dq436SKtKnLftMn y+UfRYxF6UbF2hFOaahz0SpNDdj5djZEOa+NX4lL7HflMu2uOeHGTDw8IAxDD0FC6xJz iKjz5RvDYYSaPp+CoJd34WjizWAq3kMGSs8X3w8DqHREuC1klnRMCBdjjMgV6UsdFnVa yo6sZZWcbTFudwNbnEfwUyI07ixIPBKxOL8zG5zBTnJY/XbdkidDIILVW2EuGyK3eVgD aJ8Q== X-Gm-Message-State: ALKqPwdUzLROWMWXJXUA7NPK2jrVwgdLVLsj1mKb41Uqyf3EWY+h+Z/Q ps+cWB9OioU8VJUwz9fDEaIzI7dr X-Received: by 2002:a50:ad07:: with SMTP id y7-v6mr18140571edc.78.1527599446175; Tue, 29 May 2018 06:10:46 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id c15-v6sm17443220edr.78.2018.05.29.06.10.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 06:10:45 -0700 (PDT) From: Ricardo Ribalda Delgado To: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Ricardo Ribalda Delgado , Rob Herring , Johan Hovold , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH 09/19] serdev: Provide modalias uevent for modalias devices Date: Tue, 29 May 2018 15:10:04 +0200 Message-Id: <20180529131014.18641-10-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529131014.18641-1-ricardo.ribalda@gmail.com> References: <20180529131014.18641-1-ricardo.ribalda@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Create the sysfs uevent for modalias devices. This is required by newer versions of udev for autoload modules. Cc: Rob Herring Cc: Johan Hovold Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Ricardo Ribalda Delgado --- drivers/tty/serdev/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index a9c935f68076..9414700e6442 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -46,6 +46,7 @@ ATTRIBUTE_GROUPS(serdev_device); static int serdev_device_uevent(struct device *dev, struct kobj_uevent_env *env) { int rc; + struct serdev_device *serdev = to_serdev_device(dev); /* TODO: platform modalias */ @@ -53,7 +54,11 @@ static int serdev_device_uevent(struct device *dev, struct kobj_uevent_env *env) if (rc != -ENODEV) return rc; - return of_device_uevent_modalias(dev, env); + if (rc != of_device_uevent_modalias(dev, env)) + return rc; + + return add_uevent_var(env, "MODALIAS=%s%s", SERDEV_MODULE_PREFIX, + serdev->modalias); } static void serdev_device_release(struct device *dev) -- 2.17.0