From patchwork Thu Dec 3 12:59:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7759781 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 312379F39B for ; Thu, 3 Dec 2015 13:05:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64E1C2054C for ; Thu, 3 Dec 2015 13:05:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 886DF20549 for ; Thu, 3 Dec 2015 13:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932470AbbLCNFo (ORCPT ); Thu, 3 Dec 2015 08:05:44 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36386 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932332AbbLCNFn (ORCPT ); Thu, 3 Dec 2015 08:05:43 -0500 X-Greylist: delayed 332 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Dec 2015 08:05:43 EST Received: by pfdd184 with SMTP id d184so8569419pfd.3 for ; Thu, 03 Dec 2015 05:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j0lFB2uAZPJymftt5ni5TYcQ6hNA5h3tg5XU58RmBpI=; b=YCY6HSUeh00AAVjT4dhvZGvAN8WltFLKMapYdlfp3aTM++qfgIL88K0YEBK2f0wjyj jmeZ73gjrh+55e/J9o8TFjvgyNMh7ZIsMTWRKNt9CFBgC1mAEIPkkcpVbdorDdUw3zIi jZfy/OjLBdolslSjS3hu924xMMWYBw9vZlTW2KwatoHYkQXkktmuMU/eI+rQEZj2UrWj qFQPVaQMEY2+u8caGPaF0OFPDVL9FQ15eqdiUKW1Hyw8vd5gFC4ZuIYcSnd22qjFog1s 3YwI0TZRAV44lbhfuqceV54mn309kj2oCaT1JWcj7NkbvuEYoP+77XtMd7DjTdCfllRK elGA== X-Received: by 10.98.70.138 with SMTP id o10mr12967929pfi.17.1449147620020; Thu, 03 Dec 2015 05:00:20 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([49.206.241.12]) by smtp.gmail.com with ESMTPSA id 82sm10717689pfn.76.2015.12.03.05.00.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 05:00:19 -0800 (PST) From: Sudip Mukherjee To: Mark Brown Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Sudip Mukherjee Subject: [PATCH 7/7] spi: lm70llp: use new parport device model Date: Thu, 3 Dec 2015 18:29:59 +0530 Message-Id: <1449147599-26705-7-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449147599-26705-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1449147599-26705-1-git-send-email-sudipm.mukherjee@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Modify spi-lm70llp driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee --- drivers/spi/spi-lm70llp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c index 39cf5dc..9537248 100644 --- a/drivers/spi/spi-lm70llp.c +++ b/drivers/spi/spi-lm70llp.c @@ -198,6 +198,7 @@ static void spi_lm70llp_attach(struct parport *p) struct spi_lm70llp *pp; struct spi_master *master; int status; + struct pardev_cb lm70llp_cb; if (lm70llp) { pr_warn("spi_lm70llp instance already loaded. Aborting.\n"); @@ -227,9 +228,11 @@ static void spi_lm70llp_attach(struct parport *p) * Parport hookup */ pp->port = p; - pd = parport_register_device(p, DRVNAME, - NULL, NULL, NULL, - PARPORT_FLAG_EXCL, pp); + memset(&lm70llp_cb, 0, sizeof(lm70llp_cb)); + lm70llp_cb.private = pp; + lm70llp_cb.flags = PARPORT_FLAG_EXCL; + pd = parport_register_dev_model(p, DRVNAME, &lm70llp_cb, 0); + if (!pd) { status = -ENOMEM; goto out_free_master; @@ -319,8 +322,9 @@ static void spi_lm70llp_detach(struct parport *p) static struct parport_driver spi_lm70llp_drv = { .name = DRVNAME, - .attach = spi_lm70llp_attach, + .match_port = spi_lm70llp_attach, .detach = spi_lm70llp_detach, + .devmodel = true, }; static int __init init_spi_lm70llp(void)