Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751090AbdFTDAD (ORCPT ); Mon, 19 Jun 2017 23:00:03 -0400 Received: from ozlabs.org ([103.22.144.67]:36981 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbdFTDAC (ORCPT ); Mon, 19 Jun 2017 23:00:02 -0400 From: Jeremy Kerr To: linux-kernel@vger.kernel.org Cc: Joel Stanley , Christopher Bostic , Jeremy Kerr Subject: [PATCH v2 1/3] fsi: Add fsi_master_rescan() Date: Tue, 20 Jun 2017 10:59:09 +0800 Message-Id: <1497927549-7140-1-git-send-email-jk@ozlabs.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497864405-26990-2-git-send-email-jk@ozlabs.org> References: <1497864405-26990-2-git-send-email-jk@ozlabs.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1777 Lines: 57 We'll want non-core fsi code to trigger a rescan, so introduce a non-static fsi_master_rescan() function. Use this for the existing unscan/scan behaviour too. Signed-off-by: Jeremy Kerr Reviewed-by: Joel Stanley Reviewed-by: Christopher Bostic --- v2: - Add EXPORT_SYMBOL_GPL(fsi_master_rescan) for =m builds. Thanks kbuild test robot, I'll shout you your choice of coolant. --- drivers/fsi/fsi-core.c | 10 ++++++++-- drivers/fsi/fsi-master.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index a485864..c3d59d9 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -762,14 +762,20 @@ static void fsi_master_unscan(struct fsi_master *master) device_for_each_child(&master->dev, NULL, fsi_master_remove_slave); } +int fsi_master_rescan(struct fsi_master *master) +{ + fsi_master_unscan(master); + return fsi_master_scan(master); +} +EXPORT_SYMBOL_GPL(fsi_master_rescan); + static ssize_t master_rescan_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct fsi_master *master = to_fsi_master(dev); int rc; - fsi_master_unscan(master); - rc = fsi_master_scan(master); + rc = fsi_master_rescan(master); if (rc < 0) return rc; diff --git a/drivers/fsi/fsi-master.h b/drivers/fsi/fsi-master.h index 12f7b11..18bd4ad 100644 --- a/drivers/fsi/fsi-master.h +++ b/drivers/fsi/fsi-master.h @@ -40,4 +40,6 @@ struct fsi_master { extern int fsi_master_register(struct fsi_master *master); extern void fsi_master_unregister(struct fsi_master *master); +extern int fsi_master_rescan(struct fsi_master *master); + #endif /* DRIVERS_FSI_MASTER_H */ -- 2.7.4