From patchwork Wed Apr 13 23:22:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Paul Adrian Glaubitz X-Patchwork-Id: 610316 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qlfwg294tz9t0t for ; Thu, 14 Apr 2016 09:22:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754957AbcDMXWl (ORCPT ); Wed, 13 Apr 2016 19:22:41 -0400 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:60296 "EHLO outpost1.zedat.fu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754955AbcDMXWl (ORCPT ); Wed, 13 Apr 2016 19:22:41 -0400 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (envelope-from ) id <1aqU7K-002MhK-Nz>; Thu, 14 Apr 2016 01:22:38 +0200 Received: from port-92-200-255-45.dynamic.qsc.de ([92.200.255.45] helo=[192.168.178.45]) by inpost2.zedat.fu-berlin.de (Exim 4.85) with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (envelope-from ) id <1aqU7K-000yBJ-A1>; Thu, 14 Apr 2016 01:22:38 +0200 Subject: Re: Enable module aliases for vio on sparc/sparc64 To: David Miller References: <570EC9CE.7050700@physik.fu-berlin.de> <20160413.183714.893525315444723985.davem@davemloft.net> <570ECBC3.3040200@physik.fu-berlin.de> <20160413.190103.128291414070242741.davem@davemloft.net> <570ED071.60804@physik.fu-berlin.de> Cc: sparclinux@vger.kernel.org, debian-sparc@lists.debian.org From: John Paul Adrian Glaubitz Message-ID: <570ED4BD.8060805@physik.fu-berlin.de> Date: Thu, 14 Apr 2016 01:22:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Icedove/43.0 MIME-Version: 1.0 In-Reply-To: <570ED071.60804@physik.fu-berlin.de> X-Originating-IP: 92.200.255.45 X-ZEDAT-Hint: A Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org On 04/14/2016 01:04 AM, John Paul Adrian Glaubitz wrote: > Testing a much simpler version now. Second. Attaching two patches which add modalias_show and vio_hotplug. With the patches applied, module autoloading works as expected. Going to bed now, it's past midnight here. Adrian From 8d95bce6a35dc037d1e419896af19e12b3cda910 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Thu, 14 Apr 2016 01:16:14 +0200 Subject: [PATCH 1/2] sparc/kernel/vio.c: implement modalias_show() Signed-off-by: John Paul Adrian Glaubitz --- arch/sparc/kernel/vio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index cb5789c..5a9bb9d 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c @@ -105,6 +105,13 @@ static ssize_t type_show(struct device *dev, return sprintf(buf, "%s\n", vdev->type); } +static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + const struct vio_dev *vdev = to_vio_dev(dev); + return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat); +} + static struct device_attribute vio_dev_attrs[] = { __ATTR_RO(devspec), __ATTR_RO(type), -- 2.8.0.rc3