From owner-svn-src-all@FreeBSD.ORG Tue Oct 14 20:18:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7298106569B; Tue, 14 Oct 2008 20:18:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B61668FC2F; Tue, 14 Oct 2008 20:18:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9EKIv61015294; Tue, 14 Oct 2008 20:18:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9EKIvZw015293; Tue, 14 Oct 2008 20:18:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200810142018.m9EKIvZw015293@svn.freebsd.org> From: Marius Strobl Date: Tue, 14 Oct 2008 20:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183895 - head/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 20:18:57 -0000 Author: marius Date: Tue Oct 14 20:18:57 2008 New Revision: 183895 URL: http://svn.freebsd.org/changeset/base/183895 Log: Use xpt_register_async() in order to remove code duplication. MFC after: 1 month Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Tue Oct 14 19:58:26 2008 (r183894) +++ head/sys/dev/sym/sym_hipd.c Tue Oct 14 20:18:57 2008 (r183895) @@ -8974,7 +8974,6 @@ static int sym_cam_attach(hcb_p np) struct cam_devq *devq = NULL; struct cam_sim *sim = NULL; struct cam_path *path = NULL; - struct ccb_setasync csa; int err; /* @@ -9021,12 +9020,9 @@ static int sym_cam_attach(hcb_p np) /* * Establish our async notification handler. */ - xpt_setup_ccb(&csa.ccb_h, np->path, 5); - csa.ccb_h.func_code = XPT_SASYNC_CB; - csa.event_enable = AC_LOST_DEVICE; - csa.callback = sym_async; - csa.callback_arg = np->sim; - xpt_action((union ccb *)&csa); + if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) != + CAM_REQ_CMP) + goto fail; /* * Start the chip now, without resetting the BUS, since