From patchwork Thu Apr 13 12:14:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 9679307 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 E562260383 for ; Thu, 13 Apr 2017 12:15:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D454D28654 for ; Thu, 13 Apr 2017 12:15:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C751A2865B; Thu, 13 Apr 2017 12:15:18 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 68C8128654 for ; Thu, 13 Apr 2017 12:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1bPgWn8ROp1hFBCBDzAekriz7efbBYB34pP/QIBKcZQ=; b=Dj75zae/lytxyQ YlDNnW1rckoP4HZB8nE0a42T6WY6kULHnrlGO2jF3A1/sylP7jPNJfkMt/3AjlKRqHuhQDirm9L0Z oWjUyjPFiKNacfKzRaTQ3PMDI1HsIqizKKh/00+963vJf3of1CZNlnohvkFopLX2y7/hGo+eYP8P6 X0zq3ABocx6y+XHfbZoXVhHdV2vksN4q3GS3/LH5ZOyw5uFPADmNaRTOjrIbnsUKGhXL73IZFboKL 7xVAUJFgmhKQqt5X3gM1jbxH0HPoWKj5n6MG04otfLzDkHPwfrC+fsTf98iZikJ7rOrsYMPfbVQoq jS+QtaFN01ryF7mPz2gQ==; 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 1cydef-0003Dw-L9; Thu, 13 Apr 2017 12:15:17 +0000 Received: from relay1.mentorg.com ([192.94.38.131]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cydeL-0001hF-Oa for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2017 12:14:59 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1cyde4-0001vh-0t from Jiada_Wang@mentor.com ; Thu, 13 Apr 2017 05:14:40 -0700 Received: from ubuntu.localdomain (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Thu, 13 Apr 2017 13:14:38 +0100 From: To: , , , , , Subject: [PATCH RFC 2/5] spi: spidev: use different name for SPI controller slave mode device Date: Thu, 13 Apr 2017 05:14:01 -0700 Message-ID: <1492085644-4195-3-git-send-email-jiada_wang@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1492085644-4195-1-git-send-email-jiada_wang@mentor.com> References: <1492085644-4195-1-git-send-email-jiada_wang@mentor.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170413_051457_822431_3DC805DA X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. 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: Jiada Wang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org 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: Jiada Wang SPI bus controller has started to support to work in slave mode, for device SPI controller itself works in slave mode, use name 'spidev[bus]-slv' as its name to differentiate from other SPI devices Signed-off-by: Jiada Wang --- drivers/spi/spidev.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 9e2e099..e2996fb 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -781,9 +781,18 @@ static int spidev_probe(struct spi_device *spi) struct device *dev; spidev->devt = MKDEV(SPIDEV_MAJOR, minor); - dev = device_create(spidev_class, &spi->dev, spidev->devt, - spidev, "spidev%d.%d", - spi->master->bus_num, spi->chip_select); + if (spi->slave_mode) + dev = device_create(spidev_class, &spi->dev, + spidev->devt, spidev, + "spidev%d-slv", + spi->master->bus_num); + else + dev = device_create(spidev_class, &spi->dev, + spidev->devt, spidev, + "spidev%d.%d", + spi->master->bus_num, + spi->chip_select); + status = PTR_ERR_OR_ZERO(dev); } else { dev_dbg(&spi->dev, "no minor number available!\n");