From patchwork Mon Jul 1 08:39:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 2806381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20AB9BF4A1 for ; Mon, 1 Jul 2013 08:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4416C2015C for ; Mon, 1 Jul 2013 08:42:18 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E594C2015A for ; Mon, 1 Jul 2013 08:42:16 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZfC-0003Ib-0V; Mon, 01 Jul 2013 08:40:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZf6-0003Jl-CW; Mon, 01 Jul 2013 08:40:40 +0000 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZer-0003Fb-Gy for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2013 08:40:26 +0000 Received: by mail-wg0-f52.google.com with SMTP id b12so3509669wgh.7 for ; Mon, 01 Jul 2013 01:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=oUb1YCHkYhcEf8VCkt7tuggUMUNdbRURVireHZjw708=; b=OON9D3XBX7xCdiq/P6gXBTRkJkzQdAqcQ/XFB1EQ86yQ15IqjS5/WWaOFW/5ULX8bS dkZzNBmYdyqL6zBbBF00BbxZONuN+gzfu9NaaWJuorhO5N2zY44jOOKUBHGXPZcfQlCZ FRpw6FcJp84WdjfFdxqVaQ5Pdak/gqpYtX0EYodU9iIIy0qHVczi80st9eC3JktdLF6m phJbM0NBVDaWtlfaokYO2Em13JvIZpeMyfL/Z4NZOi9VZ97yPFgs/MJJbK+nWH4I/Qdp JWnyZVUWqDTnnb9irEc12UN8HZkjeYkrNKjjA75i0c4HGNTXFILlmjHnfCutXsLsB7XW NJCA== X-Received: by 10.180.100.35 with SMTP id ev3mr11334840wib.12.1372668002066; Mon, 01 Jul 2013 01:40:02 -0700 (PDT) Received: from lnx-rg.pr (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPSA id h8sm14786574wie.1.2013.07.01.01.40.00 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jul 2013 01:40:01 -0700 (PDT) From: Richard Genoud To: devicetree-discuss@lists.ozlabs.org Subject: [RFC PATCH 02/13] misc: atmel_ssc: keep the count of pdev->id Date: Mon, 1 Jul 2013 10:39:27 +0200 Message-Id: <1372667978-4718-3-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1372667978-4718-1-git-send-email-richard.genoud@gmail.com> References: <1372667978-4718-1-git-send-email-richard.genoud@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130701_044025_831607_C4C1CEF0 X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) Cc: Richard Genoud , Nicolas Ferre , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With device tree, pdev->id is always -1, so we introduce a local counter. Signed-off-by: Richard Genoud --- drivers/misc/atmel-ssc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index 3afbd82..d1ec5ab 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -173,6 +173,12 @@ out: return err; } +/* counter of ssc devive instances. + * With device tree pdev->id is always -1, so we have to keep the + * count ourselves + */ +static int ssc_device_id; + static int ssc_probe(struct platform_device *pdev) { struct resource *regs; @@ -235,6 +241,7 @@ static int ssc_probe(struct platform_device *pdev) } spin_lock(&user_lock); + pdev->id = ssc_device_id++; list_add_tail(&ssc->list, &ssc_list); spin_unlock(&user_lock);