[PARISC] [MUX] Get the hversion directly from the parisc_device
Willy pointed out the hversion is already stored in the parisc_device, so I do not need to extract this information directly from the IODC data. Also by using the information in the parisc_device I can avoid re-reading the IODC data for the Muxes with specifed port counts. Signed-off-by: Ryan Bradetich <rbrad@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
This commit is contained in:
committed by
Kyle McMartin
parent
6142544584
commit
514fb84e1c
@@ -83,19 +83,20 @@ static struct timer_list mux_timer;
|
|||||||
*/
|
*/
|
||||||
static int __init get_mux_port_count(struct parisc_device *dev)
|
static int __init get_mux_port_count(struct parisc_device *dev)
|
||||||
{
|
{
|
||||||
|
int status;
|
||||||
u8 iodc_data[32];
|
u8 iodc_data[32];
|
||||||
unsigned long bytecnt;
|
unsigned long bytecnt;
|
||||||
|
|
||||||
int status = pdc_iodc_read(&bytecnt, dev->hpa.start, 0, iodc_data, 32);
|
|
||||||
BUG_ON(status != PDC_OK);
|
|
||||||
|
|
||||||
/* If this is the built-in Mux for the K-Class (Eole CAP/MUX),
|
/* If this is the built-in Mux for the K-Class (Eole CAP/MUX),
|
||||||
* we only need to allocate resources for 1 port since the
|
* we only need to allocate resources for 1 port since the
|
||||||
* other 7 ports are not connected.
|
* other 7 ports are not connected.
|
||||||
*/
|
*/
|
||||||
if(((iodc_data[0] << 4) | ((iodc_data[1] & 0xf0) >> 4)) == 0x15)
|
if(dev->id.hversion == 0x15)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
status = pdc_iodc_read(&bytecnt, dev->hpa.start, 0, iodc_data, 32);
|
||||||
|
BUG_ON(status != PDC_OK);
|
||||||
|
|
||||||
/* Return the number of ports specified in the iodc data. */
|
/* Return the number of ports specified in the iodc data. */
|
||||||
return ((((iodc_data)[4] & 0xf0) >> 4) * 8) + 8;
|
return ((((iodc_data)[4] & 0xf0) >> 4) * 8) + 8;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user