Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1283033

[PATCH 7/7] spi: lm70llp: use new parport device model

From Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 7/7] spi: lm70llp: use new parport device model
Date 2015-12-03 14:10 +0100
Message-ID <qBBO2-5tU-17@gated-at.bofh.it> (permalink)
References <qBBO1-5tU-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Modify spi-lm70llp driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 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)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/7] spi: lm70llp: remove multiple blank lines Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
  [PATCH 3/7] spi: lm70llp: remove cast to void Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
  [PATCH 7/7] spi: lm70llp: use new parport device model Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
  [PATCH 6/7] spi: lm70llp: remove printk Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
    Re: [PATCH 6/7] spi: lm70llp: remove printk Mark Brown <broonie@kernel.org> - 2015-12-04 13:20 +0100
  [PATCH 4/7] spi: lm70llp: correct alignment Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
  [PATCH 5/7] spi: lm70llp: remove space Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
  [PATCH 2/7] spi: lm70llp: add blank line after declaration Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100

csiph-web