linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Samuel Iglesias Gonsálvez" <siglesias@igalia.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	industrypack-devel@lists.sourceforge.net,
	"Jens Taprogge" <jens.taprogge@taprogge.org>,
	"Samuel Iglesias Gonsálvez" <siglesias@igalia.com>
Subject: [PATCH 03/16] Staging: ipack/devices/ipoctal: Convert ipoctal to directly use ioread/write functions.
Date: Tue,  4 Sep 2012 17:01:08 +0200	[thread overview]
Message-ID: <1346770881-4723-4-git-send-email-siglesias@igalia.com> (raw)
In-Reply-To: <1346770881-4723-1-git-send-email-siglesias@igalia.com>

From: Jens Taprogge <jens.taprogge@taprogge.org>

Before it was using the functions in ipack_bus_ops.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
---
 drivers/staging/ipack/devices/ipoctal.c |   29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/ipack/devices/ipoctal.c b/drivers/staging/ipack/devices/ipoctal.c
index 963ed20..085b6c0 100644
--- a/drivers/staging/ipack/devices/ipoctal.c
+++ b/drivers/staging/ipack/devices/ipoctal.c
@@ -20,6 +20,7 @@
 #include <linux/tty_flip.h>
 #include <linux/slab.h>
 #include <linux/atomic.h>
+#include <linux/io.h>
 #include "../ipack.h"
 #include "ipoctal.h"
 #include "scc2698.h"
@@ -61,16 +62,12 @@ static inline void ipoctal_write_io_reg(struct ipoctal *ipoctal,
 					unsigned char *dest,
 					unsigned char value)
 {
-	unsigned long offset;
-
-	offset = ((void __iomem *) dest) - ipoctal->dev->io_space.address;
-	ipoctal->dev->bus->ops->write8(ipoctal->dev, IPACK_IO_SPACE, offset,
-				       value);
+	iowrite8(value, dest);
 }
 
 static inline void ipoctal_write_cr_cmd(struct ipoctal *ipoctal,
-					unsigned char *dest,
-					unsigned char value)
+					u8 __iomem *dest,
+					u8 value)
 {
 	ipoctal_write_io_reg(ipoctal, dest, value);
 }
@@ -78,13 +75,7 @@ static inline void ipoctal_write_cr_cmd(struct ipoctal *ipoctal,
 static inline unsigned char ipoctal_read_io_reg(struct ipoctal *ipoctal,
 						unsigned char *src)
 {
-	unsigned long offset;
-	unsigned char value;
-
-	offset = ((void __iomem *) src) - ipoctal->dev->io_space.address;
-	ipoctal->dev->bus->ops->read8(ipoctal->dev, IPACK_IO_SPACE, offset,
-				      &value);
-	return value;
+	return ioread8(src);
 }
 
 static struct ipoctal *ipoctal_find_board(struct tty_struct *tty)
@@ -331,14 +322,11 @@ static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id)
 	unsigned char manufacturerID;
 	unsigned char board_id;
 
-	dev->bus->ops->read8(dev, IPACK_ID_SPACE,
-			IPACK_IDPROM_OFFSET_MANUFACTURER_ID, &manufacturerID);
+	manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID);
 	if (manufacturerID != IP_OCTAL_MANUFACTURER_ID)
 		return -ENODEV;
 
-	dev->bus->ops->read8(dev, IPACK_ID_SPACE,
-			IPACK_IDPROM_OFFSET_MODEL, (unsigned char *)&board_id);
-
+	board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL);
 	switch (board_id) {
 	case IP_OCTAL_232_ID:
 	case IP_OCTAL_422_ID:
@@ -449,8 +437,7 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
 	 */
 	ipoctal->dev->bus->ops->request_irq(ipoctal->dev, vector,
 				       ipoctal_irq_handler, ipoctal);
-	ipoctal->dev->bus->ops->write8(ipoctal->dev, IPACK_MEM_SPACE, 1,
-				       vector);
+	iowrite8(vector, ipoctal->dev->mem_space.address + 1);
 
 	/* Register the TTY device */
 
-- 
1.7.10.4


  parent reply	other threads:[~2012-09-04 15:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 15:01 [PATCH 00/16] ipack: autoload IP module drivers Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 01/16] Staging: ipack/bridges/tpci200: Reorganize tpci200_probe in preparation for functional changes Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 02/16] Staging: ipack/bridges/tpci200: Use the TPCI200 in big endian mode Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` Samuel Iglesias Gonsálvez [this message]
2012-09-04 15:01 ` [PATCH 04/16] Staging: ipack/bridges/tpci200: Remove the read/write functions from ipack_bus_ops Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 05/16] Staging: ipack: remove read/write operations " Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 06/16] Staging: ipack/devices/ipoctal: ipoctal cleanups Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 07/16] Staging: ipack/devices/ipoctal: Tidy up ipoctal some more Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 08/16] Staging: ipack: implement ipack device table Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 09/16] Staging: ipack: Read the ID space during device registration Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 10/16] Staging: ipack: Parse vendor and device id Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 11/16] Staging: ipack: Move device ids from ipoctal.c to ipack_ids.h Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 12/16] Staging: ipack: Make ipack_driver_ops const Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 13/16] Staging: ipack/devices/ipoctal: Expose DEVICE_TABLE for ipoctal Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 14/16] Staging: ipack: Implement device matching on the bus level Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 15/16] Staging: ipack: Expose modalias through sysfs Samuel Iglesias Gonsálvez
2012-09-04 15:01 ` [PATCH 16/16] Staging: ipack: Provide ID Prom " Samuel Iglesias Gonsálvez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346770881-4723-4-git-send-email-siglesias@igalia.com \
    --to=siglesias@igalia.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=industrypack-devel@lists.sourceforge.net \
    --cc=jens.taprogge@taprogge.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 03/16] Staging: ipack/devices/ipoctal: Convert ipoctal to directly use ioread/write functions.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).