Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030835AbWJDMZw (ORCPT ); Wed, 4 Oct 2006 08:25:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030833AbWJDMZv (ORCPT ); Wed, 4 Oct 2006 08:25:51 -0400 Received: from py-out-1112.google.com ([64.233.166.178]:62783 "EHLO py-out-1112.google.com") by vger.kernel.org with ESMTP id S1030835AbWJDMZu (ORCPT ); Wed, 4 Oct 2006 08:25:50 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=sm3TdKrsw5uTdtD7z2dvdzwgeIhXSjV2JrwZeOYLuiGDA1uhOEtcAx4A1csVQgTykLa4sCwc8aY7bsOTWA3j1O/q6UnKP0RKaPzq8BLUuJpg/p5R9LKGJAk8QxnO7lfePsQAg2R9lgaja9WJbuaE9aqnYyj9OFkbfCg0nANvE5M= In-Reply-To: <20061004200214.GA6664@localhost.Internal.Linux-SH.ORG> References: <20061004074535.GA7180@localhost.hsdv.com> <20061004200214.GA6664@localhost.Internal.Linux-SH.ORG> Mime-Version: 1.0 (Apple Message framework v749) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: B.Zolnierkiewicz@elka.pw.edu.pl, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, rmk@arm.linux.org.uk, gregkh@suse.de, ysato@users.sourceforge.jp Content-Transfer-Encoding: 7bit From: girish Subject: Re: [PATCH] Generic platform device IDE driver Date: Wed, 4 Oct 2006 21:25:43 +0900 To: Paul Mundt X-Mailer: Apple Mail (2.749) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1346 Lines: 48 On Oct 5, 2006, at 5:02 AM, Paul Mundt wrote: > On Wed, Oct 04, 2006 at 08:30:36PM +0900, girish wrote: >> question: where is linux/ide-platform.h header? >> > answer: there isn't one, as it's not needed. The reason for using > platform devices is so we get _away_ from this ridiculous static > set of > definitions for I/O addresses and IRQs that are sprinkled around a lot > of these drivers. i wrote wrong file name: where is linux/platform_device.h file? as per the patch : +#include +#include + +/* + * Users use per-port registration with a simple set of 3 resources + * per port: + * - I/O Base (IORESOURCE_IO) + * - CTL Base (IORESOURCE_IO) + * - IRQ (IORESOURCE_IRQ) + */ +static int __devinit ide_platform_probe(struct platform_device *dev) +{ + struct resource *io_res, *ctl_res; + hw_regs_t hw; + + if (unlikely(dev->num_resources != 3)) { + dev_err(&dev->dev, "invalid number of resources\n"); + return -EINVAL; + } + + io_res = platform_get_resource(dev, IORESOURCE_IO, 0); + if (unlikely(io_res == NULL)) + return -EINVAL; + - 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/