Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91172
b: refs/heads/master
c: 3d45444
h: refs/heads/master
v: v3
  • Loading branch information
Sascha Hauer authored and Russell King committed Apr 17, 2008
1 parent 71a1fcc commit 210f39f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 789d52589a0849004ced991549a61dd110dfeb10
refs/heads/master: 3d454446e2b83b4e1e2997b2c6e689c85ab61868
25 changes: 15 additions & 10 deletions trunk/drivers/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@
#define SERIAL_IMX_MAJOR 204
#define MINOR_START 41

/*
* This is the size of our serial port register set.
*/
#define UART_PORT_SIZE 0x100

/*
* This determines how often we check the modem status signals
* for any change. They generally aren't connected to an IRQ
Expand Down Expand Up @@ -721,20 +716,30 @@ static const char *imx_type(struct uart_port *port)
*/
static void imx_release_port(struct uart_port *port)
{
struct imx_port *sport = (struct imx_port *)port;
struct platform_device *pdev = to_platform_device(port->dev);
struct resource *mmres;

release_mem_region(sport->port.mapbase, UART_PORT_SIZE);
mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mmres->start, mmres->end - mmres->start + 1);
}

/*
* Request the memory region(s) being used by 'port'.
*/
static int imx_request_port(struct uart_port *port)
{
struct imx_port *sport = (struct imx_port *)port;
struct platform_device *pdev = to_platform_device(port->dev);
struct resource *mmres;
void *ret;

mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mmres)
return -ENODEV;

ret = request_mem_region(mmres->start, mmres->end - mmres->start + 1,
"imx-uart");

return request_mem_region(sport->port.mapbase, UART_PORT_SIZE,
"imx-uart") != NULL ? 0 : -EBUSY;
return ret ? 0 : -EBUSY;
}

/*
Expand Down

0 comments on commit 210f39f

Please sign in to comment.