From patchwork Thu Jan 12 22:28:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Bostic X-Patchwork-Id: 9514319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73A4960476 for ; Thu, 12 Jan 2017 22:28:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7ADA228709 for ; Thu, 12 Jan 2017 22:28:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F6D42871C; Thu, 12 Jan 2017 22:28:33 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0AEC828709 for ; Thu, 12 Jan 2017 22:28:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRnrE-0004ta-Bu; Thu, 12 Jan 2017 22:28:32 +0000 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRnrA-0004pG-Kn for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2017 22:28:30 +0000 Received: by mail-oi0-x244.google.com with SMTP id x84so4804703oix.2 for ; Thu, 12 Jan 2017 14:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2MUj/g0eH9g1/6FDSav/OpPKNaHkrMDvLO1lJJG7bfk=; b=OzGWbbaHONWokh2M2/vA+BachyDOcIdhUGte/Y19EM+tOcMUTLuIxYPyWJwcadF9kV H+pmrRHIznfyyFaQ+a+7DKsqHukYw0zOHGBhvjp8kSlH9eDfRBxso0DaLBhypIBQfHwk H9tYPxfwNQRJKTzpxdcM+DO7kJ/LFsUza+rCE+dfYTVFRWbWdlIBJIMZxhFzf4CINk1A 2e+CxaIOKjSXkLKb0SIG+eT6qdlwZyURYldJg/Ie8UEPiRVJH5GtneGK7kdu/OwD4nC0 hkN4mf+ECceGiF40SGHkBc5mo7R2W7a2Bm8rQbdeVMv4F7bzjlP1IL0Wngj6XUDAHpmX rvPg== 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=2MUj/g0eH9g1/6FDSav/OpPKNaHkrMDvLO1lJJG7bfk=; b=lR03wYmYu1v41GagtTHPCaoSYHM7thv2TFuIS4Xu/qp6FQO5eIU7VP6W24qNQz8sch T7IX3yWPNUkjuvw+C8yaa0o4YDErRatH4qeRAjR+J6NruJuUTTkKBWGTcieDcKPfGU8T nhu7FtkzKA12SG3VS5PaCKseWtcJ6rPlQ2GVFLtB12VmZjUsWp18FJqbkRpqY0+/G17R xHs9p60HQ1eejX32P2VqsYKmWEfHY1hFvB/2AdiLCSOibfbH8+qiaGpgwN/Dds1A1iuw /tpa52iqMAS7u/JWa+JOhinJq3zYjv3WOzlk7dHETerGFix3BZQeiP8ReJ2MSAqI2LQn x/rg== X-Gm-Message-State: AIkVDXI2CPXsW+3q942AX5g4+YzSnT7Ac6BdUF8ykNdGTgr1PhRM6Gps/gsrHCl0CCLn3Q== X-Received: by 10.157.8.232 with SMTP id 95mr5753275otf.188.1484260088101; Thu, 12 Jan 2017 14:28:08 -0800 (PST) Received: from Christophers-MacBook-Pro.local.com (45-20-192-79.lightspeed.austtx.sbcglobal.net. [45.20.192.79]) by smtp.gmail.com with ESMTPSA id 99sm4855814otd.28.2017.01.12.14.28.06 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 12 Jan 2017 14:28:07 -0800 (PST) From: christopher.lee.bostic@gmail.com To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, gregkh@linuxfoundation.org, mturquette@baylibre.com, geert+renesas@glider.be, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, joel@jms.id.au, jk@ozlabs.org, linux-kernel@vger.kernel.org, andrew@aj.id.au, alistair@popple.id.au, benh@kernel.crashing.org Subject: [PATCH v2 07/18] drivers/fsi: Kick off master scan via sysfs Date: Thu, 12 Jan 2017 16:28:04 -0600 Message-Id: <1484260084-79366-1-git-send-email-christopher.lee.bostic@gmail.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170112_142828_736205_F536C087 X-CRM114-Status: GOOD ( 10.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Bostic MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chris Bostic Move master scan from automatic kick off early in kernel power up to a scan file that can be invoked at any particular time based on needs of a given platform. Signed-off-by: Chris Bostic --- drivers/fsi/fsi-core.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 3160c1c..5f9f7a9 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -53,8 +53,19 @@ static int fsi_master_scan(struct fsi_master *master) fsi_slave_init(master, link, slave_id); return 0; +} + +static ssize_t store_scan(struct device *dev, + struct device_attribute *attr, + const char *buf, + size_t count) +{ + struct fsi_master *master = dev_get_drvdata(dev); + fsi_master_scan(master); + return count; } +static DEVICE_ATTR(scan, 0200, NULL, store_scan); int fsi_master_register(struct fsi_master *master) { @@ -63,8 +74,8 @@ int fsi_master_register(struct fsi_master *master) master->idx = ida_simple_get(&master_ida, 0, 0, GFP_KERNEL); get_device(master->dev); - fsi_master_scan(master); - return 0; + dev_set_drvdata(master->dev, master); + return device_create_file(master->dev, &dev_attr_scan); } EXPORT_SYMBOL_GPL(fsi_master_register);